diff options
Diffstat (limited to 'vdrmanager/src')
-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; + + } } |