can someone please help me what wrong with below written "IF CODE" this is not coming inside block everytime even the values before if is logged in console.
if(userNameString == userInstance.getUsername() && passwordString == userInstance.getPassword())
Here is the complete code:
if(userInstance == null)
{
Log.i("no record found againse User Instance",""+userInstance);
Toast.makeText(getApplicationContext(),
"User Id and Password is wrong", Toast.LENGTH_SHORT).show();
getLoaderManager().destroyLoader(arg0.getId());
}
else
{
Log.i("Record found againse User Instance 1st",""+userInstance + "userName:" + userNameString +":pass:::"+passwordString);
if(userNameString == userInstance.getUsername() && passwordString == userInstance.getPassword())
{
Log.i("Record found againse User Instance 2nd",""+userInstance);
//Log.i("UserInstance else","" + userInstance);
SessionManager.saveLoginCredentials(context,userInstance.getUsername().toString(),userInstance.getPassword().toString());
Intent intent = new Intent(LoginActivityService.this,
ProposalListActivity.class);
startActivity(intent);
getLoaderManager().destroyLoader(arg0.getId());
}
}
Here is the LogCat:
02-04 22:36:39.150: I/on LoadFinished of Loader(14572): Name: kong,Password: f10343d1dc8d44c8935b356aa3f8aae2,First Name: Kong
02-04 22:36:39.150: I/Record found againse User Instance 1st(14572): Name: kong,Password: f10343d1dc8d44c8935b356aa3f8aae2,First Name: KonguserName:kong:pass:::kongkong
EDIT: There was some logical problem the password i was getting from webservice is encoded instead of text and i was comparing the text with encoded value thats why the block of if statements were not executed.*