Android When arriving from a particular Intent
<p>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.</p>

<p>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.</p>

<p>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.</p>

<p>I tried to use this code below, but I am no expert in Java and unaware of the best way to implement this.</p>

<p>Sorry for the confusing message.</p>

<pre><code>    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);
    }
</code></pre>

<p>I keep getting a null pointer exception on the line</p>

<pre><code> if(bun.getString("WELL")==null){ well = "";}
</code></pre>
