title: Android Action Bar Search: How to filter a list by the property of a list item?
body: <p>I have a list view with a list item, which has few text views and a checkbox. Using action bar search, I need to filter out the list by a text view value. </p>
  
  <p>This is my list which I need to filter by "Priority".</p>
  
  <p><img src="https://i.stack.imgur.com/UAZL9.png" alt="enter image description here"></p>
  
  <p>This is the method I used to filter the list from the data adopter.</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.main, menu);
  
       SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
          SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
  
              searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
              searchView.setIconifiedByDefault(false);   
  
          SearchView.OnQueryTextListener textChangeListener = new SearchView.OnQueryTextListener() 
          {
              @Override
              public boolean onQueryTextChange(String newText) 
              {
                  // this is your adapter that will be filtered
                  dataAdapter.getFilter().filter(newText);
                  System.out.println("on text chnge text: "+newText);
                  return true;
              }
              @Override
              public boolean onQueryTextSubmit(String query) 
              {
                  // this is your adapter that will be filtered
                  dataAdapter.getFilter().filter(query);
                  System.out.println("on query submit: "+query);
                  return true;
              }
          };
          searchView.setOnQueryTextListener(textChangeListener);
  
          return super.onCreateOptionsMenu(menu);
  
  }
  </code></pre>
  
  <p>I have set the dataAdopter to my listview which contains few elements, i.e 3 text views and a check box.</p>
  
  <pre><code>// create an ArrayAdaptar from the String Array
      dataAdapter = new MyCustomAdapter(this, R.layout.task_info, taskList);
      listView = (ListView) findViewById(R.id.listView1);
  // Assign adapter to ListView
      listView.setAdapter(dataAdapter);
  </code></pre>
  
  <p>But when I set the adapter in the following way; using just a string array of values, the filtering happens without any issues</p>
  
  <pre><code>String[] dataArray = new String[] {"High","Medium", "Low", "Medium", "High", "Low","High"};
  listView = (ListView) findViewById(R.id.listview);
  myAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,  dataArray);
  listView.setAdapter(myAdapter);
  </code></pre>
  
  <p>Is there any method that I can use to filter the list by the value of a text view inside a list item? Or is there any alternative method to implement the desired functionality.</p>