I have a class with two buttons. Depending on which one is clicked a different value is sent to the next intent. That intent has to work with the value sent in the bundle.
The problem I am having is that the intent is also my home page and can be accessed via other classes. When these try to open it they are not setting the value in the bundle.
Basically I need a way to find out if the user has come from a particular intent and perform different actions depending on if they have or have not.
I tried to use this code below, but I am no expert in Java and unaware of the best way to implement this.
Sorry for the confusing message.
String well ="";
Intent i = getIntent();
Bundle bun = i.getExtras();
String standard = "yes";
if(bun.getString("WELL")==null){ well = "";}
else {well = bun.getString("WELL");}
if(well == standard){
buttonLogin(context);
}
I keep getting a null pointer exception on the line
if(bun.getString("WELL")==null){ well = "";}
1 Answer