Search code examples
androidandroid-fragmentsactionbarsherlock

How to hide the action bar (Sherlock) inside a Fragment?


I have an action bar set up in the main activity, and this creates a bunch of fragments. However, there are several fragments that require the action bar to be hidden, but I can't refer to the ActionBarSherlock class inside a fragment.

How can I hide the action bar? Thanks for any suggestions.


Solution

  • Actually you can refer to ActionBar via activity which you can get from a SherlockFragment by calling SherlockFragment.getSherlockActivity(), then just call SherlockFragmentActivity.getSupportActionBar() and then hide()