Fixed openOptionsMenu on large screens
This commit is contained in:
parent
eb229e8b38
commit
2f588d49bd
1 changed files with 20 additions and 0 deletions
|
@ -50,6 +50,26 @@ public class X48 extends Activity {
|
|||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue