How to remove previous view from Grid view in android
<p>I am facing a problem with <strong>GridView</strong> I have created a <strong>ImageAdapter</strong> class which extends the <strong>BaseAdapter</strong>.I have written the following code for set image on grid view.</p>

<pre><code>gridView.setAdapter(new ImageAdapter(this));
</code></pre>

<p>The problem is  <strong>When I reload this activity it appends with previous view. Images come dynamically from URL.</strong>
It is not refreshing the view. how can we remove previous view?
Thanks.</p>

<p>Here is the ImageAdapter class code:</p>

<pre><code>public class ImageAdapter extends BaseAdapter{
            Context mContext;
            public static final int ACTIVITY_CREATE = 10;
            public ImageAdapter(Context c){
                mContext = c;
            }

            public int getCount() {
                // TODO Auto-generated method stub
                return Search_List_Activity.image_me.size();
            }


            public View getView(int position, View convertView, ViewGroup parent) {
                // TODO Auto-generated method stub
                View v;

                if(convertView==null){
                    LayoutInflater li = getLayoutInflater();
                    v = li.inflate(R.layout.grid_item, null);
                    TextView tv = (TextView)v.findViewById(R.id.grid_item_text);
                    tv.setText("From  "+Search_List_Activity.min_price.get(position));
                    ImageView iv = (ImageView)v.findViewById(R.id.grid_item_image);
                    try{
                        iv.setImageBitmap(bmp[position]);
                    }
                    catch(Exception e){
                        iv.setBackgroundResource(R.drawable.no_pic_155x155);
                    }

                }
                else
                {
                    v = convertView;
                }
                return v;
            }

            public Object getItem(int arg0) {
                // TODO Auto-generated method stub
                return null;
            }

            public long getItemId(int arg0) {
                // TODO Auto-generated method stub
                return 0; 
            }
        }
</code></pre>
