I'm trying to display the login on the navigation drawer header , it worked fine when I used this piece if code
Bundle b = getIntent().getExtras();
name.setText(b.getCharSequence("username"));
But when I tried going back to the navigation drawer from another activity using the back arrow my app crashes my logcat says null pointer exception on this line
name.setText(b.getCharSequence("username"));
P.S the username is name of the variable on my php code.. help