KamCho
KamCho

Reputation: 131

Android layout issue. Missing three dots menu button

I'm testing my app on various devices and I find out that on one phone (Kruger&Matz Muve) there is no three dots button on Action bar. I have some settings in there so it have to be there. I would nice if someone could help me with this problem.

Upvotes: 1

Views: 5897

Answers (2)

Nagaraju V
Nagaraju V

Reputation: 2757

If you want to show the three dots, irrespective of device menu button then you can call this method in your Application class onCreate method-

private void makeActionOverflowMenuShown() {
//devices with hardware menu button (e.g. Samsung Note) don't show action overflow menu
try {
    ViewConfiguration config = ViewConfiguration.get(this);
    Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
    if (menuKeyField != null) {
        menuKeyField.setAccessible(true);
        menuKeyField.setBoolean(config, false);
    }
} catch (Exception e) {
    Log.d(TAG, e.getLocalizedMessage());
}
}

For more info Android action bar not showing overflow

Hope this will helps you.

Upvotes: 1

Max77
Max77

Reputation: 1566

The overflow icon only appears on phones that have no menu hardware keys

How to force action bar overflow icon to show

Upvotes: 1

Related Questions