Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void processJson(JSONObject object) {
- try {
- JSONArray rows = object.getJSONArray("rows");
- for (int r = 0; r < rows.length(); ++r) {
- JSONObject row = rows.getJSONObject(r);
- JSONArray columns = row.getJSONArray("c");
- String vendor = columns.getJSONObject(0).getString("v");
- String heading = columns.getJSONObject(1).getString("v");
- String category = columns.getJSONObject(2).getString("v");
- Offers offers1 = new Offers(vendor, heading, category);
- offerArrayList.add(offers1);
- }
- final OffersAdapter adapter = new OffersAdapter(this, R.layout.offers, offerArrayList);
- listview.setAdapter(adapter);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement