summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2012-02-23 15:34:21 +0100
committerlado <herrlado@gmail.com>2012-02-23 15:34:21 +0100
commit19568d81d69492e70cd9f295170df164117173b4 (patch)
treeace9f8381b2c2df78ac2ac469f7645a2823e623b
parente4d877b2e4b9655a29e6f82815525bf0d1193d0b (diff)
downloadvdr-manager-19568d81d69492e70cd9f295170df164117173b4.tar.gz
vdr-manager-19568d81d69492e70cd9f295170df164117173b4.tar.bz2
public static final String[] EMPTY = new String[] {};
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java57
1 files changed, 40 insertions, 17 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java
index 4be184a..a2cdc07 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java
@@ -2,8 +2,6 @@ package de.bjusystems.vdrmanager.gui;
import android.app.Activity;
import android.app.AlertDialog;
-import android.app.SearchManager;
-import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
@@ -16,9 +14,9 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
-import android.widget.SearchView;
import android.widget.Toast;
import de.bjusystems.vdrmanager.R;
+import de.bjusystems.vdrmanager.app.Intents;
import de.bjusystems.vdrmanager.app.VdrManagerApp;
import de.bjusystems.vdrmanager.data.Preferences;
import de.bjusystems.vdrmanager.data.Vdr;
@@ -33,11 +31,34 @@ public class VdrManagerActivity extends Activity implements OnClickListener {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- if(Preferences.get().getCurrentVdr() == null){
+
+ //Preferences.initVDR(this);
+
+ //if(Preferences.get().getCurrentVdr() == null){
+ //finish();
+ //return;
+ //}
+
+
+ if (Preferences.initVDR(this) == false) {
+ Intent intent = new Intent();
+ intent.setClass(this, VdrListActivity.class);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.putExtra(Intents.EMPTY_CONFIG, Boolean.TRUE);
+ startActivity(intent);
+ Toast.makeText(this, R.string.no_vdr, Toast.LENGTH_SHORT).show();
finish();
return;
- }
+ }
+
+
+
+
Preferences.setLocale(this);
+
+
+
+
// this.getActionBar().setDisplayShowCustomEnabled(true);
// this.getActionBar().setDisplayShowTitleEnabled(false);
// setTitle(getString(R.string.app_name));
@@ -61,6 +82,7 @@ public class VdrManagerActivity extends Activity implements OnClickListener {
findViewById(R.id.action_menu_wakeup).setOnClickListener(this);
}
+
// add and register buttons
// createButtons();
}
@@ -74,12 +96,12 @@ public class VdrManagerActivity extends Activity implements OnClickListener {
int api = Build.VERSION.SDK_INT;
if ( api >= 11){
- SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- SearchView searchView = (SearchView) menu.findItem(R.id.menu_search)
- .getActionView();
- searchView.setSearchableInfo(searchManager
- .getSearchableInfo(getComponentName()));
- searchView.setIconifiedByDefault(false); // Do not iconify the widget;
+// SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+// SearchView searchView = (SearchView) menu.findItem(R.id.menu_search)
+// .getActionView();
+// searchView.setSearchableInfo(searchManager
+// .getSearchableInfo(getComponentName()));
+// searchView.setIconifiedByDefault(false); // Do not iconify the widget;
}
return true;
@@ -114,12 +136,13 @@ public class VdrManagerActivity extends Activity implements OnClickListener {
finish();
break;
}
- case R.id.menu_search: {
- if(Build.VERSION.SDK_INT <11){
- onSearchRequested();
- }
- break;
- }
+
+// case R.id.menu_search: {
+ // if(Build.VERSION.SDK_INT <11){
+ // onSearchRequested();
+ //}
+ //break;
+ //}
case R.id.main_menu_goto: {
try {
final Cursor cursor = Preferences.getDatabaseHelper()