title: SearchView does not perform its function, how to filter this custom adapter?
body: <p>I have created a custom adapter that extends ArrayAdapter containing Listview with two TextView in a single row. I have SearchView on the ActionBar.In onQueryTextChange(String s) i have tried some methods which i have found, works but result is not correct, in the end i have only first row from ListView. How to make SearchView to work correctly? 
  Everything else working fine. This app is for minSdkVersion="9" and above. Any suggestion will be OK. Regards.</p>
  
  <pre><code>import android.app.SearchManager;
  import android.content.ComponentName;
  import android.content.Context;
  import android.content.Intent;
  import android.content.res.Resources;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.v4.view.MenuItemCompat;
  import android.support.v7.app.ActionBar;
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.widget.SearchView;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.Filter;
  import android.widget.ListView;
  import android.widget.TextView;
  
      public class A extends ActionBarActivity{
  
      ListView list;
      String[] titl;
      String[] opis;
      SearchView searchView;
      VjuAdapter adapter;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState); 
          setContentView(R.layout.activity);
  
          ActionBar aB = getSupportActionBar();
          aB.setDisplayHomeAsUpEnabled(true);
  
  
          Resources res=getResources();
          titl=res.getStringArray(R.array.naslov);
          opis=res.getStringArray(R.array.podnaslov);
  
          list=(ListView) findViewById(R.id.listView);
          VjuAdapter adapter=new VjuAdapter(this, titl, opis);
          adapter.getFilter().filter(null);
          list.setAdapter(adapter);
          list.setTextFilterEnabled(true);
  
      }
  
      @Override
      protected void onPause() {
          // TODO Auto-generated method stub
          super.onPause();            
  
      }
  
  
      @Override
      protected void onDestroy() {
          // TODO Auto-generated method stub
          super.onDestroy();
          finish();
      }       
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // TODO Auto-generated method stub       
           MenuInflater men = getMenuInflater();
           men.inflate(R.menu.main, menu);    
  
           SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
  
           MenuItem searchItem = menu.findItem(R.id.trazi);
           ComponentName cn = new ComponentName(this, A.class);
  
           searchView = (SearchView) MenuItemCompat.getActionView(searchItem);     
           searchView.setSearchableInfo(searchManager.getSearchableInfo(cn)); 
  
           //searchView.setOnQueryTextListener(this);
  
  
           searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
  
              @Override
              public boolean onQueryTextSubmit(String arg0) {
                  // TODO Auto-generated method stub
                  return false;
              }
  
              @Override
              public boolean onQueryTextChange(String s) {
                  // Here i have tried some methods which i have found
                  // this works but result is not correct, in the end i have
                  // only first row from ListView
  
                  /*if (TextUtils.isEmpty(s)) {
                  ((LayoutInflater) list.getAdapter()).getFilter().filter(s);
              } else {
                  adapter.getFilter().filter(s.toString());
              }
              return true;
  
          }
      });*/
                  //s.toLowerCase(Locale.getDefault());
                  VjuAdapter vd = (VjuAdapter)list.getAdapter();
                  Ll.m("POCETAK VD "+ vd);
                  Filter filter = vd.getFilter();
                  Ll.m("SRED VD.GET "+ vd.getFilter());
                  filter.filter(s);
                  Ll.m("KRAJ FILTER "+ filter);
  
  
                  /*if (TextUtils.isEmpty(s)) {
                      list.clearTextFilter();
                  } else {
                      //adapter.setSelectionAfterHeaderView();
                      adapter.getFilter().filter(s.toString());
                  }*/
  
  
  
                  return true;
  
              }
  
          });
  
  
           return super.onCreateOptionsMenu(menu);
      }
  
  
  
      public boolean onOptionsItemSelected(MenuItem item) {
          // TODO Auto-generated method stub      
          int id = item.getItemId();
          /*if (id == R.id.trazi){
              onSearchRequested();
          }*/
          if (id == android.R.id.home){
              onBackPressed();
          }
          if (id == R.id.about){
              Intent i = new Intent("com.kanna.sanjarica.ABOUT");
              startActivity(i);
              }
          if (id == R.id.oceni_apl){
              Uri uri = Uri.parse("market://details?id=" + getApplicationContext().getPackageName());
              Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
              startActivity(goToMarket);
          }
          if (id == R.id.kontakt){
              String mailTo="kanjah77@gmail.com";
              Intent email_intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto",mailTo, null)); 
              email_intent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""); 
              email_intent.putExtra(android.content.Intent.EXTRA_TEXT,""); 
  
              startActivity(Intent.createChooser(email_intent, "Pošalji email..."));
          }
          return true;
      }
      }
      class VjuAdapter extends ArrayAdapter&lt;String&gt;{
  
      Context context;
      String [] titlArray;
      String [] opisArray;
      public VjuAdapter(Context c, String[] naslov, String[] podnaslov ) {
          super(c,R.layout.single_row,R.id.textView1,naslov);
          this.context=c;
          this.titlArray=naslov;
          this.opisArray=podnaslov;
      }
      class MyViewHolder{
          TextView textVel;
          TextView textMal;
  
          MyViewHolder(View v){
              textVel=(TextView) v.findViewById(R.id.textView1);
              textMal=(TextView) v.findViewById(R.id.textView2);
          }       
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          View row=convertView;
          MyViewHolder holder=null;
          if(row==null){      
          LayoutInflater inf=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          row=inf.inflate(R.layout.single_row, parent, false);
          holder=new MyViewHolder(row);
          row.setTag(holder);
  
          }else{
              holder=(MyViewHolder) row.getTag();
          }
  
          holder.textVel.setText(titlArray[position]);
          holder.textMal.setText(opisArray[position]);
  
  
          return row;
      }   
  
  
      }
  </code></pre>