I am trying to make the Navigation drawer in my welcome page after login. But
getActionBar().setDisplayHomeAsUpEnabled(true);
throws Null pointer exception. In logcat, I got the message:
Caused by: java.lang.NullPointerException
at com.samvardhan.org.vaccinationinfo.ProfileActivity.onCreate(ProfileActivity.java:170)
I am using
Theme.AppCompat.NoActionBar . I tried to change the theme to
android:theme="@android:style/Theme.Holo.Light"
This also didn't worked. I want to use
Theme.AppCompat.NoActionBar
How to solve this issue. This
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
should not give me null value. This getActionBar() is giving me null. How could I solve this one with same theme.