I\'m creating an intent to transfer data from one activity to another like this :
Intent intent = new Intent(this, ActivityHighScore.class);
intent.putE
Well, I had a similar problem. In my case the NullPointerException
happened when I checked if my bundle.getString()
was equal to null
.
Here is how I solved it, in my case:
Intent intent = getIntent();
if(intent.hasExtra("nomeUsuario")){
bd = getIntent().getExtras();
if(!bd.getString("nomeUsuario").equals(null)){
nomeUsuario = bd.getString("nomeUsuario");
}
}