mercredi 20 mai 2015

On my android app I can't login even I get true value from database

username and password is correct but "if(username=...)" this block not work. There is no error too. Its return 0 value to onPostExecute() method.

@Override
public Integer doInBackground(Void... Params){
    try{
           ....
            if(userName=="sinan" && password=="123456")
            {
                returnValue=1;
                break;
            }
            else
            {
                returnValue=0;
            }
        }
        return returnValue;
    }
    catch (Exception ex)
    {
        return (-1);
    }
}

asdasd

   @Override
    protected void onPostExecute(Integer result){ 
  super.onPostExecute(result);      
  if(result==1)
    {
        txtViewUserName.setText(userName);
        txtViewPassword.setText(password);
    }
    else if(result.intValue()==0)
    {
        txtViewUserName.setText("Result 0");
    }
    ....
}

Aucun commentaire:

Enregistrer un commentaire