I've got a little problem, and i don't see it.
I retrieve Json data (the JSONArray
) and i wanted to make a List
of all the names in the JSONArray
, something like this.
List list = new ArrayList<String>();
for(int i=0;i < data.length();i++){
list.add(data.getJSONObject(i).getString("names").toString());
}
And i wanted to take this list in an `ListView' so i did this :
ArrayList<String> test = history_share.list;
names_list = (String[]) test.toArray();
ArrayAdapter<String> adapter = new ArrayAdapter(this,
android.R.layout.simple_list_item_1, names_list);
setListAdapter(adapter);
(history_share is one of the method i created to take json data from an api . Eclipse doesn't see any error, and me neither.
Can somebody help me please ?