I am using the default navigational drawer in Android. I want to change the title of the Action bar depending on the clicked fragment in the drawer. For this I am writing below line in my code:
getActivity().getActionBar().setTitle("Coupons");
This is returning null object. So I tried using below line of code:
getActivity().getSupportActionBar().setTitle("Coupons");
This is not able to resolve the method supportActionBar(). The activity is AppCompatActivity.