Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Menu ISSUES with some Android 4.x devices

Tags:

android

menu

I have an app that has been working fine, but suddenly some users running 4.0 devices (not all) are claiming the menu isn't working...

I have a menu with more than 6 options or whatever Android shows by default. The users are complaining that when they click on the MORE button that shows the remaining options, the pop up list showing all the other options appears but they can't click on any of the options. The list that pops up does not accept any user actions other than the back button, which closes it.

Does anyone have any idea WHY this would be going on? I am unable to reproduce the error on any device I have or on any emulator that I have.... I am assuming I am dealing with some fragmentation issue or OS change issue as the code is about as basic as it can be.

Anyone have any ideas? Was menuing significantly changed in some way that could cause this to happen?

like image 954
Speckpgh Avatar asked Aug 06 '13 12:08

Speckpgh


People also ask

How do I know if I have hardware issues on my Android phone?

Open the app and tap Device diagnosis. Choose Troubleshoot to test the touch-screen display, battery, audio, camera, connectivity, and more. Select Hardware test to run diagnostics on the display, backlight, touch screen, multi-touch capability, flash, front and rear camera, and the proximity sensor.

How do I fix device compatibility issues?

It appears to be an issue with Google's Android operating system. To fix the “your device is not compatible with this version” error message, try clearing the Google Play Store cache, and then data. Next, restart the Google Play Store and try installing the app again.


1 Answers

if i understood you issue properly then I had faced a similar type of issue,

issue--2.x has one dedicated key for menu but in 4.x do not has so we need check that in on create..

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.app_list);
        checkMenu();
                   //other stuff
        }
@SuppressLint("NewApi")
    public void checkMenu() {
    boolean hasMenu = ViewConfiguration.get(this).hasPermanentMenuKey();
        if (!hasMenu) {
            try {
    getWindow().addFlags(WindowManager.LayoutParams.class.getField( "FLAG_NEEDS_MENU_KEY").getInt(null));
        } catch (NoSuchFieldException e) {
                e.printStackTrace();
        } catch (IllegalAccessException e) {
                e.printStackTrace();
        }
        }
    }
like image 64
Biplab Avatar answered Nov 15 '22 09:11

Biplab