Hi I'm getting nullPointerException
in my application
with this line.
this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
this.getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.GRAY));
I'm extending AppCompatActivity
with my activity class
.
My Logcat says as:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference
Can you please help me clearing this issue???