Fixed openOptionsMenu on large screens

This commit is contained in:
shagr4th 2013-10-24 23:29:38 +02:00
parent eb229e8b38
commit 2f588d49bd

View file

@ -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);