Checking username and password in Android
<p>I have a username and password field and now i need to check and redirect him to the next page in Android. </p>

<pre><code>    public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);   
         setContentView(R.layout.main);
         final EditText loginText = (EditText) findViewById(R.id.widget44);
         final EditText loginPassword = (EditText) findViewById(R.id.widget47);
         final Button button = (Button) findViewById(R.id.widget48);
            button.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                 Intent myIntent = null;
                 if(loginText.getText().equals("admin") &amp;&amp; 
loginPassword.getText().equals("admin")) {
                  System.out.println("Entering");
                  myIntent = new Intent(view.getContext(), Page1.class);
                 } else {

                 }
                 startActivity(myIntent);
                }
            });
        }
</code></pre>

<p>Temp now i am checking by hardcoding the values, but this too does not work for me. Why? I usually check in <strong>Java</strong> like this, why does it not accept me the same way in Android</p>
