我有這樣如何解析這樣的JSON?
{
"status":200,
"message":"ok",
"response": {"result":1, "time": 0.0123, "values":[1,1,0,0,0,0,0,0,0]
}
}
我想獲取值數組的一個值,並把它的TextView在Eclipse JSON數據格式。看看我在eclipse中的代碼
protected void onPostExecute (String result){
try {
JSONobject json = new JSONObject(result);
tv.setText(json.toString(1));
}catch (JSONException e){
e.printStackTrace();
}
}
您的代碼似乎缺少某些部分。 「try」在哪裏?功能在哪裏關閉? – nalyd88