Why the if-else part isn't working in the code below. I checked the value of success just before if and it is returning true but the code inside if isn't working.
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
dialog.dismiss();
System.out.println(success);
if(success == "true")
{
Toast t = Toast.makeText(getApplicationContext(), "Successfully logged in", Toast.LENGTH_SHORT);
t.show();
Intent intent = new Intent(MainActivity.this, Quote_Details.class);
intent.putExtra("sessionId", sessionId);
startActivity(intent);
}
else if(success == "fals")
{
Toast f = Toast.makeText(getApplicationContext(), "LOGIN FAILED", Toast.LENGTH_LONG);
f.show();
}
}