title: Remove selected item from GridView
body: <p>Is there any way to remove selected item from <code>gridview</code>.</p>
  
  <p>I want to delete the selected <code>item</code> from my <code>gridview</code>.</p>
  
  <p>I did not find any thing . my code is </p>
  
  <pre><code>public class ImageAdapter extends BaseAdapter{
  
      Context context;
  
      public ImageAdapter(Context context)
      {
          this.context = context;
      }
      @Override
      public int getCount() {
          // TODO Auto-generated method stub
          return  mThumbIds.length;
      }
  
      @Override
      public Object getItem(int position) {
          // TODO Auto-generated method stub
          return 0;
      }
  
      @Override
      public long getItemId(int position) {
          // TODO Auto-generated method stub
          return 0;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          final ImageView imageView;
          if (convertView == null) {  // if it's not recycled, initialize some attributes
              imageView = new ImageView(context);
              imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
              imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
              imageView.setPadding(0, 5, 0, 0);
  
  
          } else {
              imageView = (ImageView) convertView;
          }
  
          imageView.setImageResource(mThumbIds[position]);
          return imageView;
      }
  
      public Integer[] mThumbIds = {
              R.drawable.sample_1,R.drawable.sample_2,R.drawable.sample_3,
              R.drawable.sample_3,R.drawable.sample_1,R.drawable.sample_2,
              R.drawable.sample_2,R.drawable.sample_3,R.drawable.sample_1
  
      };
  
  }
  </code></pre>
  
  <p>//////////////////</p>
  
  <pre><code>public class ImageActivity extends Activity {
  
      ImageAdapter iAdapter;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_image);
           iAdapter = new ImageAdapter(this);
          final GridView gView = (GridView)findViewById(R.id.grid_view);
          gView.setAdapter(iAdapter);
          gView.setOnItemClickListener(new OnItemClickListener() {
  
               public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {
                   //gView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
                  // gView.setItemChecked(position, true);
                   Toast.makeText(ImageActivity.this, "" + position, Toast.LENGTH_SHORT).show();
                  }
  
          });
          iAdapter.notifyDataSetChanged();
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.activity_image, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
  
          if(item.getItemId() == R.id.menu_delete)
          {
              Toast.makeText(this, "Delete",Toast.LENGTH_SHORT ).show();
          }
          return super.onOptionsItemSelected(item);
      }
  
  }
  </code></pre>
  
  <p>can anyone have idea .
  thank</p>