Possible Duplicate:
ActionBarSherlock & HoloEverywhere - Forcing Overflow?
I am using ActionbarSherLock library to display Actionbar on pre-Gingerbread devices..
I want Overflow menu on actionbar.. I have searched a lot and i come to know that devices that has hardware Menu Button then Overflow Menu will not display..
and i also looked into ActionbarSherlock sample demo for that solution,bt still i can't get solution..
I have created demo for actionbar,when emulate on device which has no Menu Button then it will display overflow menu but if device has Menu button then overflow menu will not displaying..
Following is my Configuration :-
public class MainActivity extends SherlockActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
setTheme(R.style.Theme_Sherlock);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater=getSupportMenuInflater();
inflater.inflate(R.menu.activity_main, menu);
// return true;
return super.onCreateOptionsMenu(menu);
}
}
Manifest :-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="demo.menu.actionbar_using_lib"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock"
>
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Menu Configuration :-
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/save"
android:title="@string/menu_save"
android:icon="@drawable/ic_action_search"
android:showAsAction="ifRoom|withText"/>
<item android:id="@+id/setting"
android:title="@string/menu_settings"
android:icon="@drawable/ic_action_search"
android:showAsAction="ifRoom|withText"/>
<item android:id="@+id/search"
android:title="@string/menu_search"
android:icon="@drawable/ic_action_search"
android:showAsAction="never"/>
<item android:id="@+id/refresh"
android:title="@string/menu_refersh"
android:icon="@drawable/ic_action_search"
android:showAsAction="never"/>
<item android:id="@+id/edit"
android:title="@string/menu_edit"
android:icon="@drawable/ic_action_search"
android:showAsAction="never"/>
<item android:id="@+id/delete"
android:title="@string/menu_delete"
android:icon="@drawable/ic_action_search"
android:showAsAction="never"/>
I want to display Overflow menu..so plz Suggest me .. Thanks in Advance..