Somehow I am getting a null pointer Exception in this method
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
actionBarToggle.syncState();
}
actionBarToggle.syncState()
in this there is a null pointer exception.
Now if I comment out this then there is null pointer exception when i touch the actionbar to open navigation drawer
if (actionBarToggle.onOptionsItemSelected(item)) {
return true;
}
I found the problem actually I was doing this
So I was intailizing the drawerLayout after using it in actionBarToggle.
I also had NullPointerException. That was a silly mistake, I was doing:
I hardcoded those two strings for accesibility by saying 1,2, because I found those strings unimportant. As far as I was running Android 2.3-4.3 everything was ok, but on 4.4 I was getting an exception. Solution is simple: just create those two strings in values/strings.xml
Sorry for my english :)
Follow the instructions here.
http://developer.android.com/training/implementing-navigation/nav-drawer.html
Your actionBarToggle object is null. Create the
ActionBarDrawerToggle
and assign it to your variable before you try to use it.