Zaid Alshami Zaid Alshami - 1 year ago 108
Android Question

how can i filter json listview

//what i want is to show in the list is the String that equals(london) in:
//String location = respons.getString("location");
//if it equlas(manchestar)i dont want it to be in the list

for (int i = 0; i < jsonArray.length(); i++) {

JSONObject respons =jsonArray.getJSONObject(i);
String id = respons.getString("id");
=String location = respons.getString("location");
String info = respons.getString("name");
String img = respons.getString("img");

listitmes.add(new Listitme(id, location, info, img));


Answer Source
JSONObject respons =jsonArray.getJSONObject(i);
// do your test hire if respons.getString("location") equlas the String "manchestar"
    String id=respons.getString("id");
    String info=respons.getString("name");
    String img=respons.getString("img");
    listitmes.add(new Listitme(id,location,info,img));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download