How do I display multiple rows of data in ListView?
Now I am only able to retrieve and display one data(Item) at a time, I want to retrieve multiple rows of data(Items) and display all them in ListView.
In this case, I am using the name of the user to retrieve the coupons he/she have in the database. So for i can only display one coupon and I want to know how to display multiple coupon in ListView.
protected String doInBackground(String... args) {
// Check for success tag
int success;
try {
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("name", name));
JSONObject json = jsonParser.makeHttpRequest(
url_all_coupons, "GET", params);
Log.d("Single Voucher Details", json.toString());
// json success tag
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
JSONArray productObj = json
.getJSONArray(TAG_COUPONS); // JSON Array
JSONObject coupons = productObj.getJSONObject(0);