Reputation: 165
I'm look for the easiest way to get an ActionBar instance from a Fragment using AppCompatLibrary and API 8.
Already tried things like
getActivity().getSupportActionBar()
but no luck.
Upvotes: 7
Views: 9703
Reputation: 4044
Try to cast it:
((YourActivity)getActivity()).getSupportActionBar()
Upvotes: 23