Zaid Alshami Zaid Alshami - 4 months ago 39
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));


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));