我的JSON數據的Json類型不匹配
{"status":"true","c_id":"72","u_name":"navneet","dob":"2015-01-12","description":"login sucessful"}
用於解析JSON數據
try {
Log.d("oooooooooooo",registerResponse);
JSONObject responseObject = new JSONObject(registerResponse);
Log.d("", "responseObjectresponseObject" + responseObject);
Status = responseObject.getString("status");
Log.d("", "StatusStatusStatus" + Status);
res_Desp = responseObject.getString("description");
Log.d("", "Status_DespStatus_DespStatus_Desp" + res_Desp);
} catch (Throwable t) {
Log.e("zxxxxxxxxxx",
"Error parsing response of change password web service - "
+ t.getMessage());
t.printStackTrace();
// return Boolean.FALSE;
}
錯誤代碼是:
01-13 11:07:02.049 11363-11490/com.example.welcome.kids_chat D/oooooooooooo﹕ <script> function abc(){if(window.location.href=="http://corouter.com/res/kidschat/login.php"){ window.location.assign('http://corouter.com/res/kidschat/login.php?username=&password='); }}</script><body onload="abc()"></body> {"status":"true","c_id":"72","u_name":"navneet","dob":"2015-01-12","description":"login sucessful"}
01-13 11:07:02.049 11363-11490/com.example.welcome.kids_chat E/zxxxxxxxxxx﹕ Error parsing response of change password web service - Value http of type java.lang.String cannot be converted to JSONObject
01-13 11:07:02.049 11363-11490/com.example.welcome.kids_chat W/System.err﹕ org.json.JSONException: Value http of type java.lang.String cannot be converted to JSONObject
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at org.json.JSON.typeMismatch(JSON.java:111)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at org.json.JSONObject.<init>(JSONObject.java:159)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at org.json.JSONObject.<init>(JSONObject.java:172)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at com.example.welcome.kids_chat.Login_Screen$loadslashscreenTask1.doInBackground(Login_Screen.java:162)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at com.example.welcome.kids_chat.Login_Screen$loadslashscreenTask1.doInBackground(Login_Screen.java:80)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:288)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
01-13 11:07:02.059 11363-11490/com.example.welcome.kids_chat W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
01-13 11:07:02.079 11363-11363/com.example.welcome.kids_chat D/AndroidRuntime﹕ Shutting down VM
如在日誌'registerResponse'無效JSON字符串 –
按您的logcat節目「<體的onload =‘ABC()’>