title: How to filter list view using search edittext with JSON url
body: <p>am using edittext for search form <code>JSON</code> url datas, i give search field. search each letter type on <code>editText</code> filter the <code>listview</code>, at same time <code>listview</code> reload, if <code>edittext</code> empty show all current list. how to that please help me...</p>
  
  <pre><code> @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.electronic_main);
  
      search = (EditText) findViewById(R.id.text_search);
      listview = (ListView) findViewById(R.id.listview);
  
      search.addTextChangedListener(new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  
          }
  
          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {
  
              ArrayList&lt;HashMap&lt;String, String&gt;&gt; arrayTemplist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
              String searchString = search.getText().toString().toLowerCase(Locale.getDefault());
              listview.setTextFilterEnabled(true);
  
              for (int i = 0; i &lt; arraylist.size(); i++) {
                  String currentString = arraylist.get(i).get(Electronic.WORKERNAME);
                  String currentPlaceString = arraylist.get(i).get(Electronic.LOCATION);
                  String currentShopString = arraylist.get(i).get(Electronic.SHOPNAME);
  
  
  
                  if (searchString.equalsIgnoreCase(currentString) ||
                          searchString.equalsIgnoreCase(currentShopString) ||
                          searchString.equalsIgnoreCase(currentPlaceString)) {
                      arrayTemplist.add(arraylist.get(i));
  
                  }
        }
              adapter = new ElectronicAdapter(Electronic.this, arrayTemplist);
              listview.setAdapter(adapter);
              adapter.notifyDataSetChanged();
  
          }
  
  
          @Override
          public void afterTextChanged(Editable s) {
              adapter.notifyDataSetChanged();
  
          }
      });
  
      Boolean isInternetPresent = cd.isConnectingToInternet(); // true or false
  
      if (isInternetPresent) {
          new DownloadJSON().execute();
  
      } else {
  
          Intent lost = new Intent(Electronic.this, NetConnection.class);
          startActivity(lost);
      }
  
  
  }
  
  
  private class DownloadJSON extends AsyncTask&lt;Void, Void, Boolean&gt; {
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
  
          mProgressDialog = new ProgressDialog(Electronic.this);
          mProgressDialog.setMessage("Loading...");
          mProgressDialog.setIndeterminate(false);
          mProgressDialog.show();
  
      }
  
      @Override
      protected Boolean doInBackground(Void... params) {
  
  
          arraylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
          jsonobject = JSONfunctions
                  .getJSONfromURL("http://beta.json-generator.com/api/json/get/D0_dGQT");
  
          try {
  
              jsonarray = jsonobject.getJSONArray("eletronics");
  
              for (int i = 0; i &lt; jsonarray.length(); i++) {
                  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                  jsonobject = jsonarray.getJSONObject(i);
  
  
                  map.put("workername", jsonobject.getString("workername"));
                  map.put("shopname", jsonobject.getString("shopname"));
                  map.put("experience", jsonobject.getString("experience"));
                  map.put("fare", jsonobject.getString("fare"));
                  map.put("location", jsonobject.getString("location"));
                  map.put("Rating", jsonobject.getString("Rating"));
                  map.put("address", jsonobject.getString("address"));
                  map.put("workerimage", jsonobject.getString("workerimage"));
                  map.put("shopphoto", jsonobject.getString("shopphoto"));
                  map.put("cell", jsonobject.getString("cell"));
  
  
                  arraylist.add(map);
              }
  
          } catch (JSONException e) {
              e.printStackTrace();
          }
          return true;
      }
  
  
      @Override
      protected void onPostExecute(Boolean arg) {
  
          listview = (ListView) findViewById(R.id.listview);
          adapter = new ElectronicAdapter(Electronic.this, arraylist);
  
          listview.setAdapter(adapter);
          mProgressDialog.dismiss();
  
      }
  
  }
  }
  </code></pre>