Hitesh Tarbundiya
Hitesh Tarbundiya

Reputation: 131

how to get given JSON value?

i am trying to get this given Jso value, but "data" value not get.

{
"result": {
"success": true,
"data": {
  "eid": "mcXRukleFJkd2O2xZvE$5w",
  "points_earned": 0,
  "post_sharing_params": {
    "message": "ajgdakalhajgajabakjkaaahkakakaha. \r\n#LifeAtCapgemini  "
  }
}
}
}

Upvotes: 0

Views: 43

Answers (1)

Buhake Sindi
Buhake Sindi

Reputation: 89169

Quite simply:

JSONObject dataJsonObject = resultJsonObject.getJSONObject("result").getJSONObject("data");

You haven't browsed the result attribute yet (where data is the child of).

Upvotes: 1

Related Questions