title: How to filter arraylist based on two values
body: <p>I have a list of items, where each and every item contains price of product, now i want to filter my arraylist based on user input</p>
  
  <p>I am accepting minimum and maximum price range, and now i would like to show records those are within these price range only.</p>
  
  <p>I am using btnSearch to filter list, to show records between two values, like i want show records those are within these two values;</p>
  
  <p>20000 to 50000</p>
  
  <pre><code>btnSearch.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  editMin.getText().toString();
                  editMax.getText().toString();
              }
          });
  </code></pre>
  
  <p>I am using below code to filter records based on High to Low price range, and for that i am using below code:</p>
  
  <pre><code>btnHTL.setOnClickListener(new OnClickListener() {
  
  @Override
  public void onClick(View arg0) {
  // TODO Auto-generated method stub
  
  Collections.sort(arrayList, new Comparator&lt;Home&gt;() {
  
      @Override
      public int compare(Home arg1, Home arg2) {
      // TODO Auto-generated method stub
          Integer obj1 = new Integer(arg1.getPrice().replace(",", ""));
          Integer obj2 = new Integer(arg2.getPrice().replace(",", ""));
          return (obj2).compareTo(obj1);
       }
     });
  
     for (int i = 0; i &lt; arrayList.size(); i++) {
        System.out.println("HTL:--" + arrayList.get(i).getPrice());                    
      }
        adapter.notifyDataSetChanged();
      }
    });
  </code></pre>