From 2f588d49bd564af0666418c82f6b8044f8c998b8 Mon Sep 17 00:00:00 2001 From: shagr4th Date: Thu, 24 Oct 2013 23:29:38 +0200 Subject: [PATCH] Fixed openOptionsMenu on large screens --- src/org/ab/x48/X48.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/org/ab/x48/X48.java b/src/org/ab/x48/X48.java index da59d1e..50496ee 100644 --- a/src/org/ab/x48/X48.java +++ b/src/org/ab/x48/X48.java @@ -49,6 +49,26 @@ public class X48 extends Activity { showDialog(DIALOG_ROM_KO); } } + + // http://stackoverflow.com/questions/9996333/openoptionsmenu-function-not-working-in-ics + // todo: really need a proper system button + @Override + public void openOptionsMenu() { + + Configuration config = getResources().getConfiguration(); + + if((config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) + > Configuration.SCREENLAYOUT_SIZE_LARGE) { + + int originalScreenLayout = config.screenLayout; + config.screenLayout = Configuration.SCREENLAYOUT_SIZE_LARGE; + super.openOptionsMenu(); + config.screenLayout = originalScreenLayout; + + } else { + super.openOptionsMenu(); + } + } public void readyToGo() { hp48s = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("hp48s", false);