Search code examples
androidandroid-actionbaractionbarsherlock

Migrating actionbarsherlock to version 4.0.2 (from 3.5)


I am migrating my app that uses actionbarsherlock 3.5 to actionbarsherlock 4.2. Almost everything is working, but i have a problem with onPrepareOptionsMenu((android.view.Menu) menu);

I need to add some items to actionbarsherlock at runtime. I do this on:

public void onPrepareOptionsMenu(Menu menu).

The problem is that this method expects an android.view.Menu as param. So, i am calling:

super.onPrepareOptionsMenu((android.view.Menu) menu);

This does not works and my menu is never created. Everything worked fine with actionbarsherlock 3.5.

Any tips?


Solution

  • It shouldn't expect android.view.Menu. Are you extending from Sherlock(Fragment)Activity/SherlockFragment?