how do show checkbox on gridview and delete checked images from gird
<p>how do i ad checkbox on gridview and on select checked images will be delete? in this code how do i modify please help me and also how do i display images in grid its own image not icon  what do ido?</p>

<pre><code>     GridView gridView;
   TextView textView;
    File currentParent;
   File[] currentFiles;
  String[] currentFilePath;
  ImageButton AddPictures;
  SimpleAdapter simpleAdapter;
  final Context context = this;

  DataBase db;

  ProgressDialog myProgressDialog = null;

  File root;

Handler handle = new Handler(){ 
    public void handleMessage(android.os.Message msg) {

        if (msg.what == 1)
        {
            hideProgress();

            //list.setAdapter(new  
   AppPhotosAdapter(getApplicationContext(),activity,0,picList));
        }
        else if (msg.what == 2)
        {
            hideProgress();
        }
        super.handleMessage(msg);   
    };
};

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    File photos = new File(getFilesDir(),"photos");
    photos.mkdirs();

    File root1 = new File("/data/data/com.newsoftwares.folderlock/files/");

    currentParent = root1;
    currentFiles = root1.listFiles();

    currentFilePath = new String[currentFiles.length];
    int count = 0;

    for(File f:currentFiles)
    {   
        currentFilePath[count] = f.getAbsolutePath();
        count++;
    }


    gridView =(GridView)findViewById(R.id.grid);
    gridView.setOnItemClickListener(new OnItemClickListener(){
        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int 
     position,long id) {


        if(currentFiles[position].isDirectory())
        {
            root = new File("/data/data/com.myexample
</code></pre>

<p>/files/"+FileName(currentFilePath[position])+"/");</p>

<pre><code>            Log.e("Root first",root+ " ");

            currentFiles = root.listFiles();

            inflateListView(currentFiles);
        }
        else if(currentFiles[position].isFile())
        {
            db = new DataBase(getBaseContext()); 
            try {
                db.createDataBase();
            } catch (IOException e1) {

                e1.printStackTrace();
            }

            Log.e("Check name",currentFiles[position].getName()+" ");

            Cursor DataC = db.selectQuery("SELECT path FROM Photos where name 
='"+currentFiles[position].getName()+"'");

            Log.e("Cursor",DataC.getCount()+" ");

            if(DataC.getCount() &gt; 0)
            {
                Bitmap bitmap = decodeFile(new 
 File(root+"/"+currentFiles[position].getName()));

                try {
                    Log.e("DB Path",DataC.getString(DataC.getColumnIndex("path"))+ " ");

                    FileOutputStream outputStream = new FileOutputStream(new File(DataC.getString(DataC.getColumnIndex("path"))));
                    outputStream.write(getBitmapAsByteArray(bitmap));
                    outputStream.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
                Log.e("Delete path 
 ",root+"/"+currentFiles[position].getName()+ " ");

                     File file = new 
      File(root+"/"+currentFiles[position].getName());
                     file.delete();

                     inflateListView(currentFiles);


            }

            DataC.close();
            db.close();
        }
    }

  });


    inflateListView(currentFiles);  
 }

private Bitmap decodeFile(File f){
    try {
        //Decode image size
        BitmapFactory.Options o = new BitmapFactory.Options();
        o.inJustDecodeBounds = true;
        BitmapFactory.decodeStream(new FileInputStream(f),null,o);

        //The new size we want to scale to
        final int REQUIRED_SIZE=70;

        //Find the correct scale value. It should be the power of 2.
        int scale=1;
        while(o.outWidth/scale/2&gt;=REQUIRED_SIZE &amp;&amp; o.outHeight/scale/2&gt;=REQUIRED_SIZE)
            scale*=2;

        //Decode with inSampleSize
        BitmapFactory.Options o2 = new BitmapFactory.Options();
        o2.inSampleSize=scale;
        return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);
    } catch (FileNotFoundException e) {}
    return null;
 }

 public byte[] fileToByte(File f)
 {
    byte[] byteArray = null;
    try
    {
         InputStream inputStream = new FileInputStream(f);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         byte[] b = new byte[1024*8];
         int bytesRead =0;

         while ((bytesRead = inputStream.read(b)) != -1)
         {
             bos.write(b, 0, bytesRead);
         }

         byteArray = bos.toByteArray();
     }
     catch (IOException e)
     {
         e.printStackTrace();
     }

     return byteArray;
  }
 ///////////////////// Get File Name from path ////////////////////////////
 public String FileName(String path)
    {
    String f = " /";
    boolean c = false;

    for(int i=path.length()-1;i&gt;0;i--)
    {
        if(c == false)
            if(path.charAt(i) == f.charAt(1))
            {
                c = true;
                return 
       path.substring(i+1,path.length());       
            }
    }

    return "";
}

  public static byte[] getBitmapAsByteArray(Bitmap bitmap) {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    bitmap.compress(CompressFormat.PNG, 0, outputStream);       
    return outputStream.toByteArray();
}

 private void showProgress()
{
    myProgressDialog = ProgressDialog.show(FileGridActivity.this,null,   
         "Loading...", true); 
}

private void hideProgress()
{
    if (myProgressDialog != null)
        myProgressDialog.dismiss();
}

   private void inflateListView(File[] files){

List&lt;Map&lt;String,Object&gt;&gt; listItems = new ArrayList&lt;Map&lt;String,Object&gt;&gt;();

 for(int i=0;i&lt;files.length;i++)
 {      
        Map&lt;String, Object&gt; listItem = new HashMap&lt;String, Object&gt;();

        if(files[i].isDirectory())
        {
            listItem.put("icon", R.drawable.folder);
        }
        else
        {
            listItem.put("icon", R.drawable.file);
        }

        listItem.put("fileName", files[i].getName());
        listItems.add(listItem);
    }

    simpleAdapter=new SimpleAdapter(this,listItems,R.layout.line,new String[]
   {"icon","fileName"},new int[]{R.id.icon,R.id.file_name});
    gridView.setAdapter(simpleAdapter);


   }
</code></pre>
