I have this code to retrieve map's key value pair:
countries = BeneficiaryJSONParser.parseCountriesFeed(result);
for(Map.Entry<String, Object> entry: countries.entrySet()) {
System.out.println(entry.getKey() + " : " + entry.getValue());
}
OUTPUT:
data : [{234=United Arab Emirates, 103=India, 210=Sri Lanka, 235=United Kingdom, 216=Switzerland, 200=Singapore, 76=France}]
status : 200
code : 1
I want to get data as an array with key and value. Because, I want to put those key-value pairs in,
final MyData items[] = new MyData[3];
items[0] = new MyData( "234","United Arab Emirates" );
items[1] = new MyData( "103","India" );
items[2] = new MyData( "210","Sri Lanka" );
.
.
.