MDRams

Untitled

Nov 14th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. private void showJSON(String response){
  2. String ID="";
  3. String Price="";
  4. String WeightUnits = "";
  5. String PWU = "";
  6. try {
  7. JSONObject jsonObject = new JSONObject(response);
  8. JSONArray result = jsonObject.getJSONArray(Config.JSON_ARRAY);
  9. JSONObject collegeData = result.getJSONObject(0);
  10. ID = collegeData.getString(Config.KEY_ID);
  11. Price = collegeData.getString(Config.KEY_Price);
  12. WeightUnits = collegeData.getString(Config.KEY_WeightUnits);
  13. PWU = collegeData.getString(Config.KEY_PWU);
  14.  
  15.  
  16. } catch (JSONException e) {
  17. e.printStackTrace();
  18. }
  19. textViewResult.setText("ID:\t"+ID+"\nPrice:\t" +Price+ "\nWeight/Units:\t"+ WeightUnits+"\nPrice per Weight/Units:\t"+PWU);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment