-5

I have this string from json, but i don`t know how to get values in quotes

[  
   "black-chest-close.png",
   "diamond-chest-close.png",
   "gold-chest-close.png",
   "logo.png",
   "logo1.png",
   "ruby-chest-close.png",
   "sapphire-chest-close.png"
]
Sudhir Ojha
  • 3,247
  • 3
  • 14
  • 24

2 Answers2

0

Replace the square brackets with curly ones and just insantiate an String array - no JSON required

String arr[] =  {"black-chest-close.png","diamond-chest-close.png","gold-chest-close.png",
                 "logo.png","logo1.png","ruby-chest-close.png","sapphire-chest-close.png"};
Scary Wombat
  • 44,617
  • 6
  • 35
  • 64
0

take a look at this tutorial also you can parse above json like

JSONArray arr = new JSONArray(yourJSONresponse);
List<String> list = new ArrayList<String>();
for(int i = 0; i < arr.length(); i++){
    list.add(arr.getJSONObject(i).getString("name"));
}
Ankit Singh
  • 173
  • 2
  • 19