Question Detail

Main.java

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
setTitle("Edit Account Details");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);

 

I am getting this error for the action bar


Thread Reply

Hemant Sharma

- 1 years ago

This error occurs by many mistakes 
i have listed below some Situations : 

 
1.) If you have not created Toolbar in your layout

2.) If you are using

android:theme="@style/AppTheme.NoActionBar"

Theme and try to get Actionbar.

3) if you have not

extends AppCompatActivity