How to disable/hide three-dot indicator(Option menu indicator) on ICS handsets

后端 未结 19 1824
闹比i
闹比i 2020-12-04 19:29

How to disable/hide three-dot indicator(Option menu indicator) on ICS handsets which does\'t have menu button. ?

I am running application as

19条回答
  •  日久生厌
    2020-12-04 19:52

    You can actually change the Android targetVersion thus forcing the 3-dot menu to either hide or show. You need to override onCreate of your Activity like this :

    @Override
    public void onCreate(Bundle savedInstanceState) {
        getApplicationInfo().targetSdkVersion = 10; // To enable the 3-dot menu call this code before super.OnCreate
        super.onCreate(savedInstanceState); 
    }
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        getApplicationInfo().targetSdkVersion = 14; // To disable the 3-dot menu call this code before super.OnCreate
        super.onCreate(savedInstanceState); 
    }
    

    Tested on Android 4.x.x and Android 3.0

提交回复
热议问题