title: Implement search for android grid view
body: <p>I have gridview in my android app which displays images and text so i want to add searchview in gridview so that when i type something in searchview i should be able to see matching gridview items.i dont know how to implement my search view for array linked to that grid.
  Thanks in advance</p>
  
  <pre><code>public class ImageAdapter extends BaseAdapter {
  private Context mContext;
  
  public ImageAdapter(Context c) {
      mContext = c;
  }
  
  public int getCount() {
      return mThumbIds.length;
  }
  
  public Object getItem(int position) {
      return null;
  }
  
  public long getItemId(int position) {
      return 0;
  }
  
  @Override
  
  
  
  // create a new ImageView for each item referenced by the Adapter
  public View getView(int position, View convertView, ViewGroup parent) {
      View grid;
  
  
      LayoutInflater inflater = (LayoutInflater) mContext
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      ViewHolder mVHolder;
      if (convertView == null) {
          // if it's not recycled, initialize some attributes
          convertView = inflater.inflate(R.layout.grid_single, parent, false);
          mVHolder=new ViewHolder();
  
  
  
          mVHolder.mTextView=(TextView)convertView.findViewById(R.id.text);
          convertView.setTag(mVHolder);
  
      } else {
          mVHolder=(ViewHolder)convertView.getTag();
      }
      mVHolder.mTextView.setText(mThumbIds[position]);
  
      return convertView;}
  
  
  
  
  // array of strings
  
  private String[] mThumbIds = {......};
   }
  
  class ViewHolder {
  
      TextView mTextView;
  
  }
  </code></pre>