File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/platform/android/app/src/main/java/net/sourceforge/smallbasic Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1212import android .content .DialogInterface .OnCancelListener ;
1313import android .content .Intent ;
1414import android .content .pm .PackageManager ;
15+ import android .content .res .Configuration ;
1516import android .content .res .Resources ;
1617import android .graphics .Rect ;
1718import android .location .Criteria ;
@@ -378,7 +379,17 @@ public void optionsBox(final String[] items) {
378379 this ._options = items ;
379380 runOnUiThread (new Runnable () {
380381 public void run () {
381- openOptionsMenu ();
382+ invalidateOptionsMenu ();
383+ Configuration config = getResources ().getConfiguration ();
384+ // https://stackoverflow.com/questions/9996333/openoptionsmenu-function-not-working-in-ics/17903128#17903128
385+ if ((config .screenLayout & Configuration .SCREENLAYOUT_SIZE_MASK ) > Configuration .SCREENLAYOUT_SIZE_LARGE ) {
386+ int originalScreenLayout = config .screenLayout ;
387+ config .screenLayout = Configuration .SCREENLAYOUT_SIZE_LARGE ;
388+ openOptionsMenu ();
389+ config .screenLayout = originalScreenLayout ;
390+ } else {
391+ openOptionsMenu ();
392+ }
382393 }
383394 });
384395 }
You can’t perform that action at this time.
0 commit comments