diff options
author | lado <herrlado@gmail.com> | 2011-10-11 01:00:41 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-11 01:00:41 +0200 |
commit | 43129e282df79662d81442a179604aee32b5235d (patch) | |
tree | bec1f206af87a0421a67b3a578519aa69d2d775c /vdrmanager/src/de | |
parent | f261af148861a578adc35eebe5b7778a04a68769 (diff) | |
download | vdr-manager-43129e282df79662d81442a179604aee32b5235d.tar.gz vdr-manager-43129e282df79662d81442a179604aee32b5235d.tar.bz2 |
backbutton option, enable disable quitting the app
Diffstat (limited to 'vdrmanager/src/de')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java | 17 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java | 14 |
2 files changed, 30 insertions, 1 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java index 0f1b731..c415465 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java @@ -105,6 +105,11 @@ public class Preferences { * Remux command Parameter */ private String remuxParameter; + + /** + * Quits the app on back button + */ + private boolean quiteOnBackButton = true; /** Properties singleton */ private static Preferences thePrefs; @@ -396,6 +401,16 @@ public class Preferences { return remuxParameter; } + + /** + * getter + * + * @return + */ + public boolean isQuiteOnBackButton() { + return quiteOnBackButton; + } + /** * Gets the previous loaded preferences @@ -481,6 +496,8 @@ public class Preferences { prefs.remuxParameter = getString(context, R.string.key_remux_parameter, ""); + prefs.quiteOnBackButton = getBoolean(context, R.string.qui_quit_on_back_key, true); + thePrefs = prefs; } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java index bc55f3c..8aa4107 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java @@ -49,7 +49,7 @@ public class VdrManagerActivity extends Activity implements OnClickListener { inflater.inflate(R.menu.main_menu, menu); return true; } - + @Override public boolean onOptionsItemSelected(final MenuItem item) { @@ -73,6 +73,9 @@ public class VdrManagerActivity extends Activity implements OnClickListener { @Override public void onBackPressed() { + if(Preferences.get().isQuiteOnBackButton()){ + super.onBackPressed(); + } } public void startActivity(Class<?> clazz) { @@ -107,4 +110,13 @@ public class VdrManagerActivity extends Activity implements OnClickListener { } } + + @Override + public boolean onSearchRequested() { + Bundle appData = new Bundle(); + //appData.putBoolean(SearchableActivity.JARGON, true); + startSearch(null, false, appData, false); + return true; + + } } |