问题描述
解决方案
有两个 arraylists 申明 keys,和 values:
String jsonString = writer.toString();
JSONObject jsonObj = new JSONObject(jsonString);
currenciesTypes = jsonObj.get(CurrenciesKey);
ArrayList<String> keys=new ArrayList<String>();
ArrayList<String> values=new ArrayList<String>();
Iterator<String> iterator=currencyType.keys();
while(iterator.hasNext())
{
String key=iterator.next();
keys.add(key);
values.add(currencyType.get(key));
}
解决方案二:
用
private static List<Map<String, String>> mListItems = new ArrayList<Map<String,String>>();
时间: 2025-01-30 02:24:02