Having issues taking out data from the internal ArrayList and variables of my Json. I'm able to read in my Json into a string and print it out, but when i call fromJson and access the resulting Class, my arraylist is empty and all the data is blank.
sample codes below.
My Json string print:
{
'ShippingList': {
'ShippingInfo': {
'ShipList_No': 'SP10000001',
'Ship_Date': 'Nov-14-2017'
},
'ItemInfo': [{
'Item_SerialNumber': 'item0000001',
'Bin_Location': '3',
'QTY': '1'
},
{
'Item_SerialNumber': 'item0000002',
'Bin_Location': '3',
'QTY': '1'
},
{
'Item_SerialNumber': 'item0000003',
'Bin_Location': '3',
'QTY': '1'
},
{
'Item_SerialNumber': 'item0000004',
'Bin_Location': '3',
'QTY': '1'
},
{
'Item_SerialNumber': 'item0000005',
'Bin_Location': '3',
'QTY': '1'
}
]
}
}
Gson Code:
Gson Gos = new Gson();
ShipList SL = Gos.fromJson(inList,ShipList.class);
String temtem = SL.getALI().get(0).getSerial();
Log.d("Proof! ","wadda " + temtem);
this prints nothing only: Proof! wadda
My classes fit what is coming out of the Json and also have been serialized. I have succesfully been able to make a class and make it into Json but i am unable to convert from Json to object properly