简体   繁体   English

Android json解析此json响应

[英]Android json parsing this json response

I have this string of json 我有这个JSON字符串

{"id":"8393933983"}

How do I parse this I'm trying like this to by using json object but its returning null pointer 我如何解析这个我试图通过使用json对象,但它返回空指针

My code 我的密码

JsonObject object = new JsonObject(response.getRawResponse);
String Id = object.getstring("id");
try {           
     JSONObject jsonObject = new JSONObject("{\"id\":\"8393933983\"}");
     String ID = jsonObject.optString("id");
    } catch (JSONException e) {
     e.printStackTrace();
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM