JSONObject.put overwrite in Hashmap
I need to convert arrylist to jsonarray ,first i added array list's item
to json object one by one. When i'm checked jsonobject some of data are
missing or overwritten.When i debug, i noticed sometimes overritten on the
data.Please give me any advice
My Code:
*for (int i=0; i < GTPVObj.Alborcmakbuz.size(); i++)
{
GTPVObj.JArray.put( GTPVObj.Alborcmakbuz.get(i).getJSONObject());
}
...
public JSONObject getJSONObject()
{
try
{
JSONObject obj = new JSONObject();
obj.put("BeyanTipi" ,getBeyanTipi ().toString());
obj.put("BeyanSiraNo",getBeyanNo ().toString());
obj.put("BeyanNo" ,getBeyanSiraNo().toString());
obj.put("Yil" ,getYil ().toString());
obj.put("Taksit" ,getTaksit ().toString());
obj.put("VadeTarihi" ,getVadeTarihi ().toString());
obj.put("Borc" ,String.valueOf(getBorc ()));
obj.put("Gecikme" ,String.valueOf(getGecikme ()));
obj.put("OdemeTutari",String.valueOf(getToplamBorc ()));
return obj;
}
catch (JSONException e)
{
Log.e("DefaultListItem.toString JSONException:",e.getMessage());
}
return null;
}
}*
i put 9 data and size is 9, but it has 6 data in HashMap, :
JSONObject (id=830027965728) nameValuePairs
HashMap (id=830026894328)
entryForNullKey null
entrySet HashMap$EntrySet (id=830027962944)
keySet null
keySet null
modCount 9
size 9
table HashMap$HashMapEntry[16] (id=830027799672)
[0] null
[1] null
[2] HashMap$HashMapEntry (id=830027681128)
[3] null
[4] HashMap$HashMapEntry (id=830027680888)
[5] HashMap$HashMapEntry (id=830027680496)
[6] null
[7] HashMap$HashMapEntry (id=830027680600)
[8] null
[9] null
[10] null
[11] null
[12] null
[13] HashMap$HashMapEntry (id=830027680696)
[14] HashMap$HashMapEntry (id=830027681328)
[15] null
threshold 12
values null
valuesCollection null
No comments:
Post a Comment