Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getActionBar from Fragment with AppCompatLibrary

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.

like image 823
2t0m Avatar asked Jul 30 '13 18:07

2t0m


1 Answers

Try to cast it:

((YourActivity)getActivity()).getSupportActionBar()
like image 98
BArtWell Avatar answered Nov 09 '22 04:11

BArtWell