Set up toolbar as actionbar in fragment

Now ActionBarActivity is deprecated so
You need to cast your activity from getActivity() to AppCompatActivity first. Here’s an example:

((AppCompatActivity) getActivity()).getSupportActionBar().setSubtitle();

The reason you have to cast it is because getActivity() returns a FragmentActivity and you need an AppCompatActivity

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)