Search code examples
androidandroid-fragmentsactionbarsherlock

Fragmentation and action bar sherlock


I am using sherlock action bar API for action bar implementation,My problem is I am using fragmentation in android.my main activity class is using more then 3 fragments to display things now I need to access that action bar in every fragment but whenever I moved from main activity to any other fragments action bar is not accessible there. when ever I call any action it gives my null pointer exception kindly need your help.


Solution

  • Be sure that other fragments are extending SherlockFragment

    And then call this method:

    this.getSherlockActivity().getSupportActionBar().setTitle(TheString);