hint:it was working with me before but I don't know what happened simply, when I click on the search icon, it doesn't expand and give me this on the logcat and this is not an exception
06-23 06:51:40.316: D/SherlockFragmentActivity(2027): [onMenuItemSelected] featureId: 0, item: Search
06-23 06:51:40.316: D/ActionBarSherlock(2027): [dispatchOptionsItemSelected] item: Search
06-23 06:51:40.316: D/ActionBarSherlock(2027): [callbackOptionsItemSelected] item: Search
06-23 06:51:40.316: D/Watson(2027): [onMenuItemSelected] featureId: 0, item: com.actionbarsherlock.internal.view.menu.MenuItemWrapper@4187d4b0
06-23 06:51:40.316: D/SherlockFragmentActivity(2027): [supportInvalidateOptionsMenu]
06-23 06:51:40.316: D/SherlockFragmentActivity(2027): [invalidateOptionsMenu]
06-23 06:51:40.316: D/ActionBarSherlock(2027): [dispatchInvalidateOptionsMenu]
06-23 06:51:40.438: D/SherlockFragmentActivity(2027): [onCreatePanelMenu] featureId: 0, menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:40.438: D/ActionBarSherlock(2027): [dispatchCreateOptionsMenu] menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:40.450: D/ActionBarSherlock(2027): [callbackCreateOptionsMenu] menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:40.450: D/Watson(2027): [onCreatePanelMenu] featureId: 0, menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:40.450: D/SherlockFragmentActivity(2027): [getSupportMenuInflater]
06-23 06:51:40.467: D/ActionBarSherlock(2027): [getMenuInflater]
06-23 06:51:40.766: D/Watson(2027): [onCreatePanelMenu] activity create result: true
06-23 06:51:40.766: D/SherlockFragmentActivity(2027): [getSupportMenuInflater]
06-23 06:51:40.766: D/ActionBarSherlock(2027): [getMenuInflater]
06-23 06:51:40.776: D/Watson(2027): [onCreatePanelMenu] fragments create result: false
06-23 06:51:40.776: D/Watson(2027): [onCreatePanelMenu] returning true
06-23 06:51:40.776: D/ActionBarSherlock(2027): [callbackCreateOptionsMenu] returning true
06-23 06:51:40.776: D/ActionBarSherlock(2027): [dispatchCreateOptionsMenu] returning true
06-23 06:51:40.797: D/SherlockFragmentActivity(2027): [onCreatePanelMenu] returning true
06-23 06:51:40.916: D/SherlockFragmentActivity(2027): [onPreparePanel] featureId: 0, view: null, menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:40.916: D/ActionBarSherlock(2027): [dispatchPrepareOptionsMenu] menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:40.916: D/ActionBarSherlock(2027): [callbackPrepareOptionsMenu] menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:40.916: D/Watson(2027): [onPreparePanel] featureId: 0, view: null menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:40.926: D/Watson(2027): [onPreparePanel] activity prepare result: true
06-23 06:51:40.926: D/Watson(2027): [onPreparePanel] fragments prepare result: false
06-23 06:51:40.926: D/Watson(2027): [onPreparePanel] returning true
06-23 06:51:40.926: D/ActionBarSherlock(2027): [callbackPrepareOptionsMenu] returning true
06-23 06:51:40.926: D/ActionBarSherlock(2027): [dispatchPrepareOptionsMenu] returning true
06-23 06:51:40.926: D/SherlockFragmentActivity(2027): [onPreparePanel] returning true
06-23 06:51:41.016: D/SherlockFragmentActivity(2027): [invalidateOptionsMenu]
06-23 06:51:41.016: D/ActionBarSherlock(2027): [dispatchInvalidateOptionsMenu]
06-23 06:51:41.079: D/SherlockFragmentActivity(2027): [onCreatePanelMenu] featureId: 0, menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:41.097: D/ActionBarSherlock(2027): [dispatchCreateOptionsMenu] menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:41.097: D/ActionBarSherlock(2027): [callbackCreateOptionsMenu] menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:41.108: D/Watson(2027): [onCreatePanelMenu] featureId: 0, menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:41.108: D/SherlockFragmentActivity(2027): [getSupportMenuInflater]
06-23 06:51:41.108: D/ActionBarSherlock(2027): [getMenuInflater]
06-23 06:51:41.316: D/Watson(2027): [onCreatePanelMenu] activity create result: true
06-23 06:51:41.316: D/SherlockFragmentActivity(2027): [getSupportMenuInflater]
06-23 06:51:41.316: D/ActionBarSherlock(2027): [getMenuInflater]
06-23 06:51:41.316: D/Watson(2027): [onCreatePanelMenu] fragments create result: false
06-23 06:51:41.316: D/Watson(2027): [onCreatePanelMenu] returning true
06-23 06:51:41.316: D/ActionBarSherlock(2027): [callbackCreateOptionsMenu] returning true
06-23 06:51:41.316: D/ActionBarSherlock(2027): [dispatchCreateOptionsMenu] returning true
06-23 06:51:41.316: D/SherlockFragmentActivity(2027): [onCreatePanelMenu] returning true
06-23 06:51:41.340: D/SherlockFragmentActivity(2027): [onPreparePanel] featureId: 0, view: null, menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:41.352: D/ActionBarSherlock(2027): [dispatchPrepareOptionsMenu] menu: com.android.internal.view.menu.MenuBuilder@41825968
06-23 06:51:41.352: D/ActionBarSherlock(2027): [callbackPrepareOptionsMenu] menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:41.352: D/Watson(2027): [onPreparePanel] featureId: 0, view: null menu: com.actionbarsherlock.internal.view.menu.MenuWrapper@41828208
06-23 06:51:41.388: D/Watson(2027): [onPreparePanel] activity prepare result: true
06-23 06:51:41.388: D/Watson(2027): [onPreparePanel] fragments prepare result: false
06-23 06:51:41.388: D/Watson(2027): [onPreparePanel] returning true
06-23 06:51:41.388: D/ActionBarSherlock(2027): [callbackPrepareOptionsMenu] returning true
06-23 06:51:41.388: D/ActionBarSherlock(2027): [dispatchPrepareOptionsMenu] returning true
06-23 06:51:41.388: D/SherlockFragmentActivity(2027): [onPreparePanel] returning true
06-23 06:51:41.406: D/ActionBarSherlock(2027): [callbackOptionsItemSelected] returning false
06-23 06:51:41.406: D/ActionBarSherlock(2027): [dispatchOptionsItemSelected] returning false
06-23 06:51:41.406: D/SherlockFragmentActivity(2027): [onMenuItemSelected] returning false
06-23 06:51:41.536: I/Choreographer(2027): Skipped 125 frames! The application may be doing too much work on its main thread.
and this is the menu xml of the search
<item
android:id="@+id/menu_search"
android:actionViewClass="android.widget.SearchView"
android:icon="@drawable/action_search"
android:showAsAction="ifRoom|collapseActionView"
android:title="@string/menu_search"/>
it was because of the functions
supportInvalidateOptionsMenu();
invalidateOptionsMenu();
that was called in onOptionsMenuClosed(), OnOptionsItemSelectedListener(), onOptionsItemSelected()
I removed them from these functions and put them on the OnCreate() method only and the purpose of these function is to declare that the options menu has changed, so should be recreated. The onCreateOptionsMenu(Menu) method will be called the next time it needs to be displayed.