mirror of
https://github.com/shagr4th/droid48
synced 2024-12-26 21:58:12 +01:00
Fixed openOptionsMenu on large screens
This commit is contained in:
parent
eb229e8b38
commit
2f588d49bd
1 changed files with 20 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue