Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void showJSON(String response){
- String ID="";
- String Price="";
- String WeightUnits = "";
- String PWU = "";
- try {
- JSONObject jsonObject = new JSONObject(response);
- JSONArray result = jsonObject.getJSONArray(Config.JSON_ARRAY);
- JSONObject collegeData = result.getJSONObject(0);
- ID = collegeData.getString(Config.KEY_ID);
- Price = collegeData.getString(Config.KEY_Price);
- WeightUnits = collegeData.getString(Config.KEY_WeightUnits);
- PWU = collegeData.getString(Config.KEY_PWU);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- textViewResult.setText("ID:\t"+ID+"\nPrice:\t" +Price+ "\nWeight/Units:\t"+ WeightUnits+"\nPrice per Weight/Units:\t"+PWU);
- }
Advertisement
Add Comment
Please, Sign In to add comment