grid view with search in Android
<p>I code gridview using lazyadapter and i am getting images from image url but i dont know how to put a search for that gridview can any one helps to me.Thanks in advance. i am using below code.</p>

<pre><code>final GridView gridView = (GridView) findViewById(R.id.grid_view);

        SQLiteDatabase db1 = openOrCreateDatabase("GRID", MODE_PRIVATE, null);
        Cursor cur = db1.rawQuery("SELECT * from vehicleimg ", null);
        if (cur != null) {
            if (cur.moveToFirst()) {
                do {
                    String link = cur.getString(cur.getColumnIndex("ImgUrl"));
                    url1.add(link);
                } while (cur.moveToNext());
            }
        }
        cur.close();


        String[] url = url1.toArray(new String[url1.size()]);

        Cursor cur1 = db1.rawQuery("SELECT * from vehicleimgId limit 21", null);
        if (cur1 != null) {
            if (cur1.moveToFirst()) {
                do {
                    String link = cur1.getString(cur1.getColumnIndex("ImgID"));
                    imgid.add(link);

                } while (cur1.moveToNext());
            }
        }
        cur1.close();
        db1.close();
        String[] txt1 = imgid.toArray(new String[21]);
        adapter = new LazyAdapter1(this, url,txt1);
        gridView.setAdapter(adapter);
}
</code></pre>

<p>LazyAdapter1.class:</p>

<pre><code>public class LazyAdapter1 extends BaseAdapter {

    private Activity activity;
    private String[] data;
    private String[] data1;
    private String[] txt1;
    private String[] txt2;
    private static LayoutInflater inflater = null;
    public ImageLoader imageLoader;


    public LazyAdapter1(Activity a, String[] url, String[] txt12) {
     activity=a;
     data=url;
     txt1=txt12;
     inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
     imageLoader=new ImageLoader(activity.getApplicationContext());
    }

    public int getCount() {
        return data.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        View vi = convertView;
        if (convertView == null)
            vi = inflater.inflate(R.layout.myvehicle_screen1, null);

        TextView text1 = (TextView) vi.findViewById(R.id.txt1);
        ImageView image = (ImageView) vi.findViewById(R.id.vehicle1);
        text1.setText(txt1[position]);
        imageLoader.DisplayImage(data[position], image);
        return vi;
    }


}
</code></pre>
