Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. Ion.with(this)
  2. .load("http://marketplace.envato.com/api/edge/search:audiojungle,,happy.json")
  3. .asString().setCallback(new FutureCallback<String>() {
  4.  
  5. @Override
  6. public void onCompleted(Exception arg0, String data) {
  7. // TODO Auto-generated method stub
  8.  
  9. try {
  10. JSONObject jObject = new JSONObject(data);
  11. JSONArray jArray = jObject.getJSONArray("search");
  12.  
  13. for (int i = 0; i < jArray.length(); i++) {
  14. JSONObject jObject_0 = jArray.getJSONObject(i);
  15. JSONObject jObj = jObject_0
  16. .getJSONObject("item_info");
  17. cost.setText(jObj.getString("cost"));
  18. item.setText(jObj.getString("item"));
  19. user.setText(jObj.getString("user"));
  20. preview_value.setText(jObj
  21. .getString("preview_type"));
  22. length.setText(jObj.getString("length"));
  23.  
  24. String s = jObj.getString("thumbnail");
  25.  
  26. Ion.with(getBaseContext()).load(s).withBitmap()
  27. .intoImageView(image);
  28.  
  29. Log.d("item", item.toString());
  30.  
  31. }
  32.  
  33. } catch (JSONException e) {
  34. // TODO Auto-generated catch block
  35. e.printStackTrace();
  36. }
  37. }
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement