So i converted a JSOn object and compared the value with something,and even though the value matches with whats there in the string,the loop is not getting invoked,this what i've written Any help would be appreciated
@Override
protected void onPostExecute(String s) {
JSONObject obj = null;
try {
obj = new JSONObject(s);
String error_desc = obj.getString("error_desc");
writeToFile("responseONP="+error_desc);
if(error_desc == "Invalid Credentials") {
Context context = getApplicationContext();
CharSequence text = error_desc;
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
else{
Intent intent = new Intent(getBaseContext(), HomepageNormal.class);
startActivity(intent);
}
} catch (JSONException e) {
e.printStackTrace();
}