title: If statement with booleans android
body: <p>I have been having a problem with a Boolean in an if statement all day and it is really starting to irritate me now!! I have looked at other Android threads on here and the solutions just don't seem t work.</p>
  
  <p>My code started off like this:</p>
  
  <pre><code>public class MainActivity extends Activity 
  {
  public static boolean isSignedIn = false;       
  
  public final static String USERNAME_MESSAGE = "com.example.libnoise.MESSAGE";
  Button btnSignIn;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);       
  
  
      btnSignIn = (Button) findViewById(R.id.btnSignIn);
      Intent intent = getIntent();
      String message = intent.getStringExtra(PlayZone.USERNAME_MESSAGE); 
  
      if(isSignedIn == false))
      {
     btnSignIn.setText("SignIn");
      }
      else
      {       
           btnSignIn.setText(message);
      }        
  }
  </code></pre>
  
  <p>Then I had a thought that made it's not like other languages and I only need one "=" sign so I had it as this:</p>
  
  <pre><code>    if(isSignedIn = false)
      {
     btnSignIn.setText("SignIn");
      }
      else
      {       
           btnSignIn.setText(message);
      }  
  </code></pre>
  
  <p>That didn't work and that's when I started looking online, after finding a previous thread on here  changed it to the following:</p>
  
  <pre><code>    if("false".equals(isSignedIn))
      {
     btnSignIn.setText("SignIn");
      }
      else
      {       
           btnSignIn.setText(message);
      }  
  </code></pre>
  
  <p>Now that doesn't look right to me in the first place but hoped it would work and it didn't.</p>
  
  <p>As this is the MainActivity it loads first however since I added all this, the app crashes before it will even load when I take out the if statement it work as expected.</p>
  
  <p>Any ideas?</p>