Code example for GridView

Methods: getSelectedItemId

0
                          null,       
                          null); 
                  
                  column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
                  
                  cursor.moveToPosition((int) g.getSelectedItemId());
                  
                  String filename = cursor.getString(column_index);
                  Toast.makeText(GalleryImage.this, filename, Toast.LENGTH_SHORT).show();
            } 
        });         
    } 
 
    public class ImageAdapter extends BaseAdapter {
 
        public ImageAdapter(Context c) {
            mContext = c;
        } 
 
        public int getCount() { 
          return cursor.getCount();