thieumao

Read JSON

Dec 20th, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1.             try {
  2.                 JSONObject categories = new JSONObject(json);
  3.  
  4.                 JSONObject category = categories.getJSONObject("nodes");
  5.  
  6.                 Iterator<?> keys = category.keys();
  7.  
  8.                 while (keys.hasNext()) {
  9.                     String key = (String) keys.next();
  10.                     JSONObject cate = category.getJSONObject(key);
  11.  
  12.                     String title = cate.getString("title");
  13.                     Log.d("title", title);
  14.                 }
  15.             } catch (JSONException e) {
  16.                 // TODO Auto-generated catch block
  17.                 e.printStackTrace();
  18.             }
Advertisement
Add Comment
Please, Sign In to add comment