mercredi 1 juillet 2015

android.database.CursorIndexOutOfBoundsException Index -1 requested, with a size of 0

android.database.CursorIndexOutOfBoundsException Index -1 requested, with a size of 0

email2 and password2 will get values entered by the user.

public int getemail(String email2, String password2)

{

    // TODO Auto-generated method stub
    String [] rows=new String [] {First_Name, Last_Name, Email, Password, Phone_Number, Gender};

    String password="";
    Cursor c =ourDatabase.query(Database_Table, rows, "Email=?",new String [] {email2}, null, null, null, null);

    password=c.getString(c.getColumnIndex(Password));
    if(password.equals(password2))
    {
        return 1;
    }
    else
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire