title: Android: Search through ListView objects via SearchView
body: <p>I want to put search feature to my app via <code>SearchView</code> in <code>ActionBar</code> - I have <code>ListView</code> with some objects. When the search is submitted i want to show the data which is contained in search query to show in another activity in a <code>ListView</code>. To store the data am I using <a href="http://parse.com" rel="nofollow">Parse.com</a> framework. I followed <a href="http://www.edumobile.org/android/android-development/action-bar-search-view/" rel="nofollow">this</a> easy tutorial, but I know that it is not made for searching through <code>ListView</code> items, but it searches throuh globa items - downloaded apps etc.</p>
  
  <p><strong>Setting up SearchView in <code>MainActivity.class</code></strong></p>
  
  <pre><code>@Override
          public boolean onCreateOptionsMenu(Menu menu) {
  
  
              getMenuInflater().inflate(R.menu.main, menu);
              MenuItem searchItem = menu.findItem(R.id.action_search);
              mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem);
              setupSearchView(searchItem);
              return true;
          }
  
       private void setupSearchView(MenuItem searchItem) {
           SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
              if (searchManager != null) {
                  List&lt;SearchableInfo&gt; searchables = searchManager.getSearchablesInGlobalSearch();
  
                  SearchableInfo info = searchManager.getSearchableInfo(getComponentName());
                  for (SearchableInfo inf : searchables) {
                      if (inf.getSuggestAuthority() != null
                              &amp;&amp; inf.getSuggestAuthority().startsWith("applications")) {
                          info = inf;
                      }
                  }
                  mSearchView.setSearchableInfo(info);
              }
  
              mSearchView.setOnQueryTextListener(this);
          }
   @Override
      public boolean onQueryTextChange(String arg0) {
          return false;
      }
  
  
  
      @Override
      public boolean onQueryTextSubmit(String arg0) {
          Toast.makeText(getBaseContext(), "submited", Toast.LENGTH_SHORT).show();
          return false;
      }
  </code></pre>
  
  <p><strong>My <code>Animal.class</code> - getters and setters (check the <code>//note</code>):</strong></p>
  
  <pre><code>@ParseClassName("Animal")
  public class Animal extends ParseObject{
  
      public Animal(){
  
        }
  
        public String getAnimal(){    //I want to search by these objects
            return getString("animal");
        }
  
        public void setAnimal(String animal){
            put("animal", animal);
        }
  
        public String getArea(){
            return getString("area");
        }
  
        public void setArea(String area){
            put("area", area);
        }
  
        public String getImgUrl(){
            return getString("imgUrl");
        }
  
        public void setImgUrl(String imgUrl){
            put("imgUrl", imgUrl);
        }
  
        public String getAbout(){
            return getString("about");
        }
  
        public void setAbout(String about){
            put("about", about);
        }
  
  
  
  }
  </code></pre>
  
  <p>Do you know, if is there some way how to customize it to search through my items in ListView? Or is there completely different but better way, how to do it?</p>
  
  <p>Thanks in advance</p>