Skip to content Skip to sidebar Skip to footer

Android - Want To Show 3-dots Menu On Ics

I want to show the 3-dot overflow menu key (next to the RecentApp virtual key) when building my app with android:targetSdkVersion='15' Here is my story. My app includes two lib p

Solution 1:

I think you simply can't. That "overflow menu" in system bar is there for legacy reasons, and it shows up if and only if a legacy app (target sdk<11) runs on a device with the virtual system bar. It's simply not intended to show up when targeting higher versions.

Solution 2:

No you cannot do it. You might download an earlier version of actionBarSherlock (ie 4.1.0) where absForceOverflow was an existing method, so this will force your 3-dot menu to every system up to 1.6, but this could cause you issues (like phones with hardware keyboard etc).

I stumbled this issue couple of weeks ago and I solved this with a workaround: a simple menu icon into the actionbar (the 3-dot icon), and if you click on it a custom dialog appears which looks just like the original menu (you can programmatically place it to the right place, since you know that the default height of the bar (e.g. 48dp on hdpi phones) ).

Hope this helps.

Solution 3:

Yes you can you just need to change targetVersion from your onCreate method like this :

@OverridepublicvoidonCreate(Bundle savedInstanceState) {
    getApplicationInfo().targetSdkVersion = 10; // To enable the 3-dot menu call this code before super.OnCreatesuper.onCreate(savedInstanceState); 
}

Tested on Android 4.x.x and Android 3.0

Post a Comment for "Android - Want To Show 3-dots Menu On Ics"