You still might want to check that the activity.getSupportActionBar() is not null