String checkLoginJSON = "[{\"Authenticated\":\"ok\",\"SessionId\":\"1234\"}]";
JSONArray entries = new JSONArray(checkLoginJSON);
if(entries.getJSONObject(0).getString("Authenticated") == "ok"){
//ServerComm.sessionId = entries.getJSONObject(0).getString("SessionId").toString();
Toast.makeText(LoginActivity.this, "Login Successful",Toast.LENGTH_LONG).show();
Intent i = new Intent(LoginActivity.this, HomeActivity.class);
startActivity(i);
finish();
}
Can anyone help me? I'm geting exception when trying tu compare JSONobject with string.

New Topic/Question
Reply



MultiQuote



|