Search code examples
androidactionbarsherlock

ActionBarSherlock with Fragments


I'm new to Android and using this very useful API. In my application I have a pager and 4 fragments.

I want to update the action bar based on events on each fragment e.g. an OnlistItemClick event. But I can't interfere with the ActionBar from the fragment.

How can I overcome this problem?


Solution

  • You can refer to the ActionBar from any of your Fragments using the getActivity().getActionBar() call. Hope this helps.