Please bear with me with this.Follow through the whole code.I will be putting everything just to be clear:

And this is my json : you can format here
[{"productLineItemId":5,"restaurantId":2,"productId":5,"catalogName":"Cold Drink","categoryName":"sprite","subCategoryName":"SPRITE ","productName":"SPRITE","price":20.0,"optionName":"no","optionValues":"200ML","veg":true,"spicy":false},{"productLineItemId":8,"restaurantId":2,"productId":5,"catalogName":"veg","categoryName":"south indian","subCategoryName":"rice","productName":"jeera Rice","price":888.0,"optionName":"notning","optionValues":"ooo","veg":true,"spicy":true},{"productLineItemId":100,"restaurantId":2,"productId":5,"catalogName":"non veg","categoryName":"south indian","subCategoryName":"hot briyani","productName":"briyani","price":9.0,"optionName":"plate","optionValues":"half","veg":true,"spicy":true}]
Now Here ,you can see inside that json we have 3 objects right now,which in future will be dynamic,means could be many number.So, my goal is to retrieve all those Json Objects and show them in a custom adaptor list.
Below these are my codes: MainActivity.java
try {
httpClient2=new DefaultHttpClient();
StringBuilder stringBuilder2=new StringBuilder("xxxxxxxx");
httpPost2=new HttpPost(stringBuilder2.toString());
httpResponse2=httpClient2.execute(httpPost2);
code=httpResponse2.getStatusLine().getStatusCode();
httpPost2.setHeader(HTTP.CONTENT_TYPE,"application/json");
HttpEntity httpEntity2=httpResponse2.getEntity();
if(code<200 && code>=300){
Log.d("msg","Here <200 and >300");
}
else{
if(httpEntity2!=null){
cena= EntityUtils.toString(httpEntity2);
JSONArray jsonArray=new JSONArray(cena);
hashMapArrayList=new ArrayList<HashMap<String,String>>();
for(int i=0;i<jsonArray.length();i++) {
jsonObject = jsonArray.getJSONObject(i);
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("Price", jsonObject.getString("price"));
hashMap.put("CategoryName", jsonObject.getString("categoryName"));
hashMap.put("ProductName", jsonObject.getString("productName"));
hashMap.put("CatalogName", jsonObject.getString("catalogName"));
hashMapArrayList.add(hashMap);
}
Intent intent = new Intent(MainActivity.this, Checkout.class);
intent.putExtra("arrayhash",hashMapArrayList);
startActivity(intent);
Log.d("cena","got something here"+cena.toString());
}
//Checkout.java
listView=(ListView)findViewById(R.id.listView);
hashMapArrayList2=(ArrayList<HashMap<String,String>>) getIntent().getSerializableExtra("arrayhash");
price_a = new String[hashMapArrayList2.size()];
categoryName_b = new String[hashMapArrayList2.size()];
productName_c = new String[hashMapArrayList2.size()];
catalogName_d = new String[hashMapArrayList2.size()];
int i=0;
for(Map<String,String> item:hashMapArrayList2){
price_a[i]=item.get("Price");
categoryName_b[i]=item.get("CategoryName");
productName_c[i]=item.get("ProductName");
catalogName_d[i]=item.get("CatalogName");
i++;
}
customAdapter=new CustomAdapter(Checkout.this,price_a,categoryName_b,productName_c,catalogName_d);
listView.setAdapter(customAdapter);
//This is my Custom Adaptor
public CustomAdapter(Context context,String price[],String categoryName[],String productName[],String catalogName[]){
this.context=context;
this.price=price;
this.categoryName=categoryName;
this.productName=productName;
this.catalogName=catalogName;
}
@Override
public int getCount() {
return price.length;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
layoutInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v=layoutInflater.inflate(R.layout.custom_row,null);
tv2=(TextView)v.findViewById(R.id.textView2);
tv3=(TextView)v.findViewById(R.id.textView3);
tv4=(TextView)v.findViewById(R.id.textView4);
tv5=(TextView)v.findViewById(R.id.textView5);
return v;
}
//So i Am getting output like this :

//Now You could see the problem,I have 3 json objects but I am getting only one which I am able to show.Could you show me where modificatiuons needs to be so that I could show all json objects(dynamic) in custom adapter.I hope you got the full understanding.And I am new to development and If I have done any mistakes then sorry,deeply appreciated.
After some modification suggested from comment section,I got these :
Duplicate 