Why does my if statement not work? What is wrong with my code? : <p>So when I put in the proper credentials in the EditText bars, I still get the ACCESS DENIED message. What should happen is that I should get the ACCESS GRANTED message instead of ACCESS DENIED. So what is wrong with my if statement?</p>

<pre><code>        LinearLayout layout = new LinearLayout(this);
        layout.Orientation = Orientation.Vertical;

        TextView userText = new TextView(this);
        TextView passText = new TextView(this);

        EditText userInput = new EditText(this);
        EditText passInput = new EditText(this);

        TextView access = new TextView(this);
        access.Text = "";

        Button loginButton = new Button(this);
        loginButton.Text = "Login";

        userText.Text = "Username";
        passText.Text = "Password";

        userInput.SetMaxLines(1);
        passInput.SetMaxLines(1);

        string username = userInput.Text;
        string password = passInput.Text;

        loginButton.Click += (sender, e) =&gt;
        { CheckCredentials(); };

        void CheckCredentials()
        {
            if (username == "Admin" &amp;&amp; password == "adminpass")
            {
                access.Text = "ACCESS GRANTED!";
            }
            else
            {
                access.Text = "ACCESS DENIED!";
            }
        }

        SetContentView(layout);
        layout.AddView(userText);
        layout.AddView(userInput);
        layout.AddView(passText);
        layout.AddView(passInput);
        layout.AddView(loginButton);
        layout.AddView(access);
</code></pre>

<p>Should print out ACCESS GRANTED when you put 'Admin' as the username and 'adminpass' as the password.</p>
