while loop login
<p>I've completed my login page. My problem now is I can only log in using the first account created. I found out that I have not complete my login page. The missing item is the while..loop code so that the application will check the other existing user instead of only looking for a match for the first user.</p>

<pre><code>if(username.equals(c.getString(1)))
            {
                if(password.equals(c.getString(2)))
                {
                    Context context = getApplicationContext();
                    int duration = Toast.LENGTH_LONG;
                    Toast toast = Toast.makeText(context, "LOGIN SUCCESS", duration);
                    toast.show();

                    Intent intent=new Intent(Login.this,Test.class);
                    startActivity(intent);

                }
</code></pre>

<p>I do know that the code is something like  <code>while (c.moveToNext())</code> but I do not know how to apply it on my if..else statement.</p>

<p>I hope you can help me out on this simple task. Thank you!</p>
