简体   繁体   中英

Android json parsing this json response

I have this string of json

{"id":"8393933983"}

How do I parse this I'm trying like this to by using json object but its returning null pointer

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();
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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