android - Menu not showing in SherlockFragmentActivity -


i have

import com.actionbarsherlock.app.sherlockfragment; import com.actionbarsherlock.app.sherlockfragmentactivity; import com.actionbarsherlock.view.menu; import com.actionbarsherlock.view.menuinflater; import com.actionbarsherlock.view.menuitem;   public class activityhome extends sherlockfragmentactivity             {                 super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_home);    ........... }  @override     public boolean oncreateoptionsmenu(menu menu) {         menuinflater inflater = getsupportmenuinflater();         inflater.inflate(r.menu.menu_main, menu);         return true;     } 

but menu not showing in title bar, in bottom of screen(by clicking "menu" button on device). normal activity... doing wrong??

menu xml is:

<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" >     <item         android:id="@+id/menu_add_record"         android:icon="@drawable/ic_action_plus"         android:title="@string/add"         >     </item> </menu> 

please help! :)

you can individual menu items show in actionbar adding android:showasaction="always" attribute

http://developer.android.com/guide/topics/resources/menu-resource.html


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -