after i import the project and fix some problem i got the json error like the title i mention, can you help me please. In the IDE nothing with error sign (red sign)
if you need anything else just ask below
Here is my code
@Override
protected void onPostExecute(String Result) {
dialog.dismiss();
if (Result != null) {
parseJson(Result); // here problem
} else {
// intent_depan();
Toast.makeText(LoginActivity.ctx,
"Login Failed, Connection Error", Toast.LENGTH_SHORT)
.show();
}
}
// Android monitor show the problem maybe here
public void parseJson(String s) {
try {
JSONObject jobj = new JSONObject();
String stat = jobj.getString("stat");
// Log.i("json result", "string result " + s1);
if (stat.equals("failed")) {
String msg = jobj.getString("msg");
Toast.makeText(LoginActivity.ctx, msg, Toast.LENGTH_SHORT)
.show();
} else {
userName = jobj.getString("name");
// Toast.makeText(LoginActivity.ctx, userName,
// Toast.LENGTH_SHORT).show();
saveLoginState();
goToMainActivity();
}
/*
* if (s1 == "success") { intent_depan(); } else {
* intent_depan(); }
*/
} catch (JSONException e) {
e.printStackTrace();
Toast.makeText(LoginActivity.ctx, e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
parseJson(String s)method..You should create yourJSONObjectasJSONObject jobj = new JSONObject(s);