android Volley how to parse Json first node "usercard" signle time and "cards" multiple time Repeat as loop getter setter Object how to use ArrayList
json Structure completed
object Store data ArrayList ;
please Help me
{
"status": "success",
"data": {
"usercard": {
"UsrID": "822",
"UsrTitle": "Mr.",
"UsrFNm": "RAI",
"UsrMNm": "S",
"UsrLNm": "Patil",
"UsrPicture": "1686cd3e8c3336deb124ee4f0e514f44_t.jpg?1476251936",
"UsrDsgntnNm": "Software Developer",
"UsrCompID": "456",
"UsrCompNm": "Miracle RAI Test",
"UsrCompRoleDesc": "",
"UsrBrID": "710",
"UsrFun": "",
"UsrCity": "1131447",
"UsrCityNm": "Mumbai",
"UsrState": "1618",
"UsrStateNm": "Maharashtra",
"UsrCty": "107",
"UsrCtyNm": "India",
"UsrBuy": "",
"UsrSell": "",
"UsrPriInd": "41",
"UsrPriIndNm": "Digital & Technology",
"UsrSecInd": "147",
"UsrSecIndNm": "Digital Services",
"UsrArtReadCnt": "0",
"UsrArtWriteCnt": "0",
"UsrDisReadCnt": "0",
"UsrDisWriteCnt": "0",
"UsrComWriteCnt": "0",
"UsrDisResCnt": "0",
"UsrJoinDate": "",
"UsrCompVerified": "0",
"UsrProCompletion": "36",
"UsrLinkCnt": "3",
"UsrSts": "A",
"UsrMobileSts": "1",
"UsrEmailSts": "1",
"UsrTyp": "2",
"EntID": "9",
"UsrAdrsLn1": "",
"UsrAdrsLn2": "",
"UsrAdrsLn3": "",
"UsrAdrsPinCd": "",
"UsrDegree": "2",
"UsrFavorites": 0,
"UsrLinkSts": "",
"UsrLoginID": "s.",
"UsrWebsite": "",
"UsrCreatedDate": "2016-10-12 05:58:58",
"UsrTwitter": "",
"UsrBlog": "",
"UsrSocialOther": "",
"SMERole": "",
"Source": "",
"DOB": "",
"UsrProfileComplected": "36"
},
"user_links": {
"total_count": "3",
"cards": [
{
"UsrID": "946",
"UsrTitle": "Ms.",
"UsrFNm": "mi",
"UsrMNm": "p",
"UsrLNm": "sawde",
"UsrPicture": "rofile/MS.png",
"UsrDsgntnNm": "Html Developer",
"UsrCompID": "494",
"UsrCompNm": "pqr",
"UsrCompRoleDesc": "",
"UsrBrID": "752",
"UsrFun": "",
"UsrCity": "1131447",
"UsrCityNm": "Mumbai",
"UsrState": "1618",
"UsrStateNm": "Maharashtra",
"UsrCty": "107",
"UsrCtyNm": "India",
"UsrBuy": "",
"UsrSell": "",
"UsrPriInd": "38",
"UsrPriIndNm": "Computers, Peripherals & Applications",
"UsrSecInd": "394",
"UsrSecIndNm": "Software and Support Services",
"UsrArtReadCnt": "0",
"UsrArtWriteCnt": "0",
"UsrDisReadCnt": "0",
"UsrDisWriteCnt": "0",
"UsrComWriteCnt": "0",
"UsrDisResCnt": "0",
"UsrJoinDate": "",
"UsrCompVerified": "0",
"UsrProCompletion": "33",
"UsrLinkCnt": "1",
"UsrSts": "A",
"UsrMobileSts": "1",
"UsrEmailSts": "1",
"UsrTyp": "2",
"EntID": "9",
"UsrAdrsLn1": "",
"UsrAdrsLn2": "",
"UsrAdrsLn3": "",
"UsrAdrsPinCd": "",
"UsrDegree": "3",
"UsrFavorites": 0,
"UsrLinkSts": ""
},
{
"UsrID": "445",
"UsrTitle": "Mr.",
"UsrFNm": "Somin",
"UsrMNm": "",
"UsrLNm": "Patil",
"UsrPicture": "hprofile/SP.png",
"UsrDsgntnNm": "Software Developer",
"UsrCompID": "271",
"UsrCompNm": "Miracle-ICICI Web Solutions Pvt. Ltd.",
"UsrCompRoleDesc": "BizDev",
"UsrBrID": "425",
"UsrFun": "Administration",
"UsrCity": "1131447",
"UsrCityNm": "Mumbai",
"UsrState": "1618",
"UsrStateNm": "Maharashtra",
"UsrCty": "107",
"UsrCtyNm": "India",
"UsrBuy": "",
"UsrSell": "",
"UsrPriInd": "41",
"UsrPriIndNm": "Digital & Technology",
"UsrSecInd": "147",
"UsrSecIndNm": "Digital Services",
"UsrArtReadCnt": "3",
"UsrArtWriteCnt": "0",
"UsrDisReadCnt": "4",
"UsrDisWriteCnt": "1",
"UsrComWriteCnt": "0",
"UsrDisResCnt": "1",
"UsrJoinDate": "2015-01-16 00:00:00",
"UsrCompVerified": "2",
"UsrProCompletion": "49",
"UsrLinkCnt": "16",
"UsrSts": "A",
"UsrMobileSts": "2",
"UsrEmailSts": "1",
"UsrTyp": "2",
"EntID": "8",
"UsrAdrsLn1": "",
"UsrAdrsLn2": "",
"UsrAdrsLn3": "",
"UsrAdrsPinCd": "",
"UsrDegree": "1",
"UsrFavorites": 0,
"UsrLinkSts": "connected"
},
{
"UsrID": "351",
"UsrTitle": "Mr.",
"UsrFNm": "Ysh",
"UsrMNm": "s",
"UsrLNm": "Yahoo",
"UsrPicture": "c40bbd1e50addca687b6e75ae658f_t.jpg?1401777417",
"UsrDsgntnNm": "Software Developer",
"UsrCompID": "212",
"UsrCompNm": "Technova",
"UsrCompRoleDesc": "",
"UsrBrID": "345",
"UsrFun": "",
"UsrCity": "1131447",
"UsrCityNm": "Mumbai",
"UsrState": "1618",
"UsrStateNm": "Maharashtra",
"UsrCty": "107",
"UsrCtyNm": "India",
"UsrBuy": "282",
"UsrSell": "345,367,368",
"UsrPriInd": "31",
"UsrPriIndNm": "Automotives, Automobiles & Vehicles",
"UsrSecInd": "391",
"UsrSecIndNm": "Automobile Parts Manufacturer",
"UsrArtReadCnt": "4",
"UsrArtWriteCnt": "1",
"UsrDisReadCnt": "8",
"UsrDisWriteCnt": "2",
"UsrComWriteCnt": "0",
"UsrDisResCnt": "2",
"UsrJoinDate": "",
"UsrCompVerified": "0",
"UsrProCompletion": "53",
"UsrLinkCnt": "8",
"UsrSts": "A",
"UsrMobileSts": "2",
"UsrEmailSts": "1",
"UsrTyp": "2",
"EntID": "7",
"UsrAdrsLn1": "Hallmark plaza",
"UsrAdrsLn2": "Nr. MIG colony",
"UsrAdrsLn3": "",
"UsrAdrsPinCd": "400051",
"UsrDegree": "2",
"UsrFavorites": 0,
"UsrLinkSts": ""
}
]
}
}
}
Related
I have to fetch the value from an array nested inside another array. I can fetch values from the first array but not able to fetch values from the second array.
I am able to read the values from the main array but I am unable to read the values from the array which is nested inside it.
JSONObject jsono = new JSONObject(res);
JSONArray jarray = jsono.getJSONArray("data");
for (int i = 0; i < jarray.length(); i++)
{
JSONObject object = jarray.getJSONObject(i);
JSONArray jarray1 = object.getJSONArray("comments_data");
for (int j = 0; j < jarray1.length(); j++)
{
JSONObject object1 = jarray1.getJSONObject(j);
String Namee = object1.getString("username");
String Ratingg = object1.getString("rating");
String Commentt = object1.getString("comment");
Comments comments1 = new Comments();
comments1.setUsername(Namee);
comments1.setRating(Ratingg);
comments1.setComments(Commentt);
comments1.setProfileimage(R.drawable.fav);
commentsList.add(comments1);
}
}
And this is my json.
{
"status": "success",
"msg": " Menu Details",
"data": [
{
"id": "1",
"rest_id": "1",
"menu_rate": "100",
"collection_time": "2:22pm",
"quantity_left": "3",
"food_type": "veg",
"img1": "",
"img2": "",
"img3": "",
"date": "",
"menu_name": "",
"comments_data": [
{
"id": "20",
"user_id": "127",
"res_id": "1",
"comment": "shreyansh s",
"date": "0000-00-00 00:00:00",
"rating": "0.0",
"username": "lucky",
"userimage": "123"
},
{
"id": "19",
"user_id": "126",
"res_id": "1",
"comment": "das",
"date": "0000-00-00 00:00:00",
"rating": "3.0",
"username": "shrey srivastava",
"userimage": "123"
},
{
"id": "18",
"user_id": "126",
"res_id": "1",
"comment": "",
"date": "0000-00-00 00:00:00",
"rating": "3.0",
"username": "shrey srivastava",
"userimage": "123"
},
{
"id": "17",
"user_id": "126",
"res_id": "1",
"comment": "sakjbdkjasbk",
"date": "0000-00-00 00:00:00",
"rating": "3.0",
"username": "shrey srivastava",
"userimage": "123"
},
{
"id": "16",
"user_id": "107",
"res_id": "1",
"comment": "hello",
"date": "0000-00-00 00:00:00",
"rating": "5",
"username": "shreyansh",
"userimage": ""
},
{
"id": "15",
"user_id": "107",
"res_id": "1",
"comment": "hello",
"date": "0000-00-00 00:00:00",
"rating": "5",
"username": "shreyansh",
"userimage": "123"
},
{
"id": "14",
"user_id": "107",
"res_id": "1",
"comment": "hello",
"date": "0000-00-00 00:00:00",
"rating": "5",
"username": "shreyansh",
"userimage": "123"
},
{
"id": "6",
"user_id": "82",
"res_id": "1",
"comment": "good",
"date": "0000-00-00 00:00:00",
"rating": "",
"username": "jaim",
"userimage": "google.com"
}
]
}
]
}
Note carefully how you JSON is built.
First, you have to query for "data". You get JSON-Array. So you traverse it by the indices.
Hence, you query for the specific index in "data" (you can use a loop, of course).
For each iteration, you get a JSONObject, and in it you query for "comments_data".
String json = "{ \"status\": \"success\", \"msg\": \" Menu Details\", \"data\": [ { \"id\": \"1\", \"rest_id\": \"1\", \"menu_rate\": \"100\", \"collection_time\": \"2:22pm\", \"quantity_left\": \"3\", \"food_type\": \"veg\", ...
JSONObject object = new JSONObject(json);
JSONObject jarray1 = jarray_data.getJSONObject(0);
JSONArray comments = jarray1.getJSONArray("comments_data");
I have a json array of about 60 objects, each having about 50 fields. when I use fromJson, it is assigning the values accurately to all fields except one, "stops". "stops" is getting filled with "-1". This is the json string part for "stops" and below that is the class snippet.
"carrierid": "SG",
"stops": "0",
"seatsavailable": "1",
#SerializedName("carrierid")
#Expose
private String carrierid;
#SerializedName("stops")
#Expose
private String stops;
#SerializedName("seatsavailable")
#Expose
private String seatsavailable;
Please let me know what I might be doing wrong.
{
"data": {
"returnflights": [
{
"origin": "TRV",
"rating": 0,
"DepartureTime": "",
"flightcode": "3428",
"Group": "",
"farebasis": "LSAVER",
"FlHash": "rSG-3428",
"spicestatus": "Normal",
"holdflag": "",
"CINFO": "air-TRV-BLR-20171103--1-0-0-E-100--",
"deptime": "17:20",
"codeshare": "",
"tickettype": "e",
"ibibopartner": "spicejetnew",
"productclass": "RS",
"duration": "1h 35m",
"platingcarrier": "",
"qtype": "fbs",
"carriercode": "SG",
"flightno": "3428",
"servicetype": "J",
"fareclass": "L",
"faresequence": "5",
"destination": "BLR",
"depterminal": "1",
"carrierid": "SG",
"stops": "0",
"seatsavailable": "1",
"state": "Clean",
"arrterminal": "-",
"provider": "",
"PromotionId": "",
"fare": {
"grossamount": 5280,
"totalbasefare": 4275,
"adultbasefare": 4275,
"totalfare": 5280,
"totalsurcharge": 0,
"totaltaxes": 1005,
"adulttax": 1005,
"adulttotalfare": 5280,
"totalcommission": ""
},
"CabinClass": "",
"fareapptype": "Route",
"warnings": "Refundable",
"ArrivalTime": "",
"isallotmentmarketfare": "false",
"onwardflights": [],
"aircraftType": "DH8",
"seatingclass": "E",
"EticketFlag": "true",
"faresellkey": "0~L~~LSAVER~2022~~5~X",
"operatingcarrier": "",
"std": "2017-11-03T17:20:00",
"src": "",
"sta": "2017-11-03T18:55:00",
"ruleno": "2022",
"splitduration": "1h 35m",
"searchKey": "0:0:0:0:0:4275:0:5280:0:0:0:0:0:0:0:0:0:4275:5280:0:0:0:0:0:0",
"bookingclass": "",
"journeysellkey": "SG~3428~ ~~TRV~11/03/2017 17:20~BLR~11/03/2017 18:55~",
"airline": "spicejet",
"classofservice": "L",
"multicitysearch": "",
"depdate": "2017-11-03t1720",
"arrtime": "18:55",
"arrdate": "2017-11-03t1855",
"TravelTime": ""
},
{
"origin": "TRV",
"rating": 0,
"DepartureTime": "",
"flightcode": "874",
"Group": "",
"farebasis": "T0IP",
"FlHash": "r6E-874",
"spicestatus": "Normal",
"holdflag": "",
"CINFO": "air-TRV-BLR-20171103--1-0-0-E-100--",
"deptime": "07:50",
"codeshare": "",
"tickettype": "e",
"ibibopartner": "indigonew",
"productclass": "R",
"duration": "1h 20m",
"platingcarrier": "",
"qtype": "fbs",
"carriercode": "6E",
"flightno": "874",
"servicetype": "J",
"fareclass": "T",
"faresequence": "2",
"destination": "BLR",
"depterminal": "-",
"carrierid": "6E",
"stops": "0",
"seatsavailable": "1",
"state": "Clean",
"arrterminal": "-",
"provider": "",
"PromotionId": "",
"fare": {
"grossamount": 3808,
"totalbasefare": 2350,
"adultbasefare": 2350,
"totalfare": 3808,
"totalsurcharge": 0,
"totaltaxes": 1458,
"adulttax": 1458,
"adulttotalfare": 3808,
"totalcommission": ""
},
"CabinClass": "",
"fareapptype": "Route",
"warnings": "Refundable",
"ArrivalTime": "",
"isallotmentmarketfare": "false",
"onwardflights": [],
"aircraftType": "320",
"seatingclass": "E",
"EticketFlag": "true",
"faresellkey": "0~T~~T0IP~1059~~2~X",
"operatingcarrier": "",
"std": "2017-11-03T07:50:00",
"src": "",
"sta": "2017-11-03T09:10:00",
"ruleno": "1059",
"splitduration": "1h 20m",
"searchKey": "0:0:0:0:0:2350:0:3808:0:0:0:0:0:0:0:0:0:2350:3808:0:0:0:0:0:0",
"bookingclass": "",
"journeysellkey": "6E~ 874~ ~~TRV~11/03/2017 07:50~BLR~11/03/2017 09:10~",
"airline": "Indigo",
"classofservice": "T",
"multicitysearch": "",
"depdate": "2017-11-03t0750",
"arrtime": "09:10",
"arrdate": "2017-11-03t0910",
"TravelTime": ""
}
]
},
"data_length": 2
}
This question already has answers here:
org.json.JSONArray cannot be converted to JSONObject
(5 answers)
Closed 5 years ago.
this is my JSON result when I print the log.I am not able to get the data from this result.Please suggest how to get the data from this result. The error shows the of type org.json.JSONArray cannot be converted to JSONObject.I know there are already many posts related to this but I can't understand how to get the data.
09-12 05:12:57.606: W/System.err(3385): org.json.JSONException: Value
[
{
"client": [
{
"office_name": "",
"is_verified": "1",
"forum_email_notification": "1",
"city": "",
"first_name": "Pratik",
"balance": "0",
"option_domain_name": "Vision",
"initials": "Mr",
"client_type": "0",
"group_credit": "0.00",
"gender": "0",
"is_approved": "1",
"domain_name": "Vision",
"client_id": "2",
"otherim": "",
"credit": "0.00",
"is_spam": "0",
"office_phone": "",
"parent_id": "0",
"domain_url": "http://example.com/vision4/sandip/v5/",
"fax": "",
"forum_signature_content": "",
"group_id": "1",
"optionB_domain_id": "1",
"country": "",
"contact_number": "",
"user_name": "test",
"email": "pratik#test.com",
"job_title": "",
"last_name": "T",
"parent_name": "",
"temporary_address": "",
"facebook_id": "",
"language": "1",
"office_contact_num": "",
"salt": "e2e838b89b16f488a901b3b364ad839e",
"zip_code": "",
"office_website": "",
"department": "",
"state": "",
"office_fax": "",
"login_as": "0",
"currency": "USD",
"permanent_address": "",
"department_access": "0",
"is_manager": "0",
"birthdate": "",
"registration_date": "1504254310",
"parent_email": "",
"password_auth": "0",
"group_name": "Default",
"netmeetingid": "",
"website": "",
"domain_id": "1",
"is_banned": "0",
"twitter_id": "",
"mobile_number": "",
"office_address": "",
"authentication": "383Y4A==",
"harvest_id": "0",
"image_path": "",
"office_email": ""
}
],
"unsolve": 3,
"solve": 0
}
]
of type org.json.JSONArray cannot be converted to JSONObject
It's because your result is an array of JSONObject and not a JSONObject itself
I am getting following json in response from an api:
{
"0": {
"review_id": "2",
"ad_id": "27",
"user_id": "2",
"name": "John1",
"rating": "4",
"title": "Nice object1",
"comment": "Nice",
"status": "1",
"created_date": "2016-12-12 15:46:18",
"modified_date": "2016-12-12 21:17:24",
"modified_by": "0",
"add_title": "Sell new new plot"
},
"1": {
"review_id": "3",
"ad_id": "27",
"user_id": "2",
"name": "John2",
"rating": "3",
"title": "Nice object2",
"comment": "Nice",
"status": "1",
"created_date": "2016-12-12 12:46:18",
"modified_date": "2016-12-12 21:17:24",
"modified_by": "0",
"add_title": "Sell new new plot"
},
"2": {
"review_id": "4",
"ad_id": "27",
"user_id": "2",
"name": "John3",
"rating": "4",
"title": "Nice object3",
"comment": "Nice",
"status": "1",
"created_date": "2016-12-12 11:46:18",
"modified_date": "2016-12-12 21:17:24",
"modified_by": "0",
"add_title": "Sell new new plot"
},
"status": 1,
"count": 3,
"msg": "Total Number of found records "
}
When i try to create pojo classes of this json, it does not give correct classes. Can someone please help me how to parse this json?
Thanks.
I have following pattern of JSON
{
"menu": [{
"id": "74",
"parent_id": "0",
"title": "Mobiles & Tablets",
"menu_type": "7",
"menu_icon_image": "",
"link": "#",
"childs": [{
"id": "75",
"parent_id": "74",
"title": "Mobile Phones",
"menu_type": "7",
"menu_icon_image": "",
"link": "categories/mobile-tablets"
}, {
"id": "76",
"parent_id": "74",
"title": "Mobile Accessories",
"menu_type": "7",
"menu_icon_image": "",
"link": "#"
}, {
"id": "77",
"parent_id": "74",
"title": "Tablets",
"menu_type": "7",
"menu_icon_image": "",
"link": "#"
}, {
"id": "78",
"parent_id": "74",
"title": "Audio & Video",
"menu_type": "7",
"menu_icon_image": "",
"link": "#"
}, {
"id": "79",
"parent_id": "74",
"title": "Laptops",
"menu_type": "7",
"menu_icon_image": "",
"link": "#"
}]
}, {
"id": "80",
"parent_id": "0",
"title": "WOMEN",
"menu_type": "7",
"menu_icon_image": "",
"link": "#",
"childs": [{
"id": "81",
"parent_id": "80",
"title": "GIRLS CLOTHING",
"menu_type": "7",
"menu_icon_image": "",
"link": "categories/womens-clothing"
}]
}],
"slider": [{
"id": "56",
"url": "#",
"default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-itwQr56f76f6df2bea.png/88e5b614324080684af061c510496d29",
"title": "Mobile Test Slider",
"image": null,
"days": null
}, {
"id": "55",
"url": "#",
"default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-uIXFZ56f76efbcd627.png/e5a0e22dcb0de1007c88c16db1aebb7f",
"title": "Mobile Test Slider",
"image": null,
"days": null
}, {
"id": "52",
"url": "#",
"default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-QULkY56f7719eb0915.png/a4d0065b56b57b7d01d44873bbdb1df8",
"title": "Mobile Test Slider",
"image": null,
"days": null
}, {
"id": "51",
"url": "#",
"default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-L0ROK56f7716acccf0.png/e194ea4403c4b4b7e17f1fecfa329f22",
"title": "Mobiles & Tablets",
"image": null,
"days": null
}, {
"id": "1",
"url": "",
"default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-qtvVk56f60fd0379b9.jpg/510c150029fd29d1d77b869d837b126e",
"title": "Slider Add",
"image": null,
"days": null
}],
"advertise": [{
"id": "54",
"usrl": "categories/mobile-tablets",
"default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-IWkmH56f66a2b60bde.jpg/05571c3c78954e1a461b87bd62698273",
"title": "Mobile phone home page advertise",
"image": null,
"days": null
}, {
"id": "53",
"usrl": "categories/mobile-tablets",
"default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/3-fl-YK1pI56f5102a7237b.png/118b3074314006a62a7f10867a447be6",
"title": "Mobile phone home page advertise",
"image": null,
"days": null
}]
}
List<ExpanTitelandTotal> result1111 = new ArrayList<ExpanTitelandTotal>();
for (int i = 0; i < menuArrayList.size(); i++) {
ExpanTitelandTotal mExpanTitelandTotal11 = new ExpanTitelandTotal();
mExpanTitelandTotal11.setTitle(menuArrayList.get(i).getTitle());
mExpanTitelandTotal11.setLink(menuArrayList.get(i).getLink());
mExpanTitelandTotal11.setId(Integer.parseInt(menuArrayList.get(i).getId()));
//result1111.add(mExpanTitelandTotal11);
if (mGetDrawerAndHome.getMenu().get(i).getChilds().size() > 0) {
mExpanTitelandTotal11.setIsMultiple(true);
Log.d("mGetDrawerAndHome.getMenu().get(i).getChilds().size() ",String .valueOf(mGetDrawerAndHome.getMenu().get(i).getChilds().size()));
for (int j = 0; j < mGetDrawerAndHome.getMenu().get(i).getChilds().size(); j++)
{
Log.d("Sub Menu", mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getTitle());
ExpanTitelandTotal mExpanTitelandTotal = new ExpanTitelandTotal();
mExpanTitelandTotal.setTitle(mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getTitle());
mExpanTitelandTotal.setLink(mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getLink());
mExpanTitelandTotal.setId(Integer.parseInt(mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getId()));
result1111.add(mExpanTitelandTotal);
}
} else {
mExpanTitelandTotal11.setIsMultiple(false);
}
mExpanTitelandTotal11.setItemList(result1111);
mArrayListExpanTitelandTotals.add(mExpanTitelandTotal11);
}
listAdapterTNA = new ExpandableListAdapterTNA(ActivityDrawer.this, mArrayListExpanTitelandTotals, mExpandableListView);
mExpandableListView.setAdapter(listAdapterTNA);
mExpandableListView.setIndicatorBounds(10, 80);
mExpandableListView.setDivider(null);
above is my code and when i run this i get following output
In expandable list view two different category data store in all main category data ? any idea how can i solve this ?
Create a new List object inside the first for loop sentence:
List<ExpanTitelandTotal> result1111;
for (int i = 0; i < menuArrayList.size(); i++) {
result1111 = new ArrayList<ExpanTitelandTotal>();
/////YOUR CODE
}