title: how to add checkbox in gridview? so multi select is possible
body: <p>below is my source code which work fine for single select i want to add checkbox to  select multiple pictures plz help me what do i do?? how do i change my simpleadapter? or how to add checkbox in simpleadapter?? plz help me im so confuse</p>
  
  <pre><code>      public class FileGridActivity extends Activity {
  
    GridView gridView;
    TextView textView;
    File currentParent;
    File[] currentFiles;
    String[] currentFilePath;
    ImageButton AddPictures;
    SimpleAdapter simpleAdapter;
    final Context context = this;
    DataBase db;
    List&lt;AppPhotosData&gt; picList;
    ProgressDialog myProgressDialog = null;
    File CameraRoll;
  
  
  
    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.newsoftwares.folderlock/files/"+FileName(currentFilePath[position])+"/");
  
              Log.e("Root first",root+ " ");
  
              currentFiles = root.listFiles();
  
              inflateListView(currentFiles);
          }
          else if(currentFiles[position].isFile())
          {
                       inflateListView(currentFiles);
          }
      }
  
      });
  
  
                       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",  files[i]);
          }
  
          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);
  
  
  
  
             &lt;!-----------main.xml------------&gt;
  
                &lt;?xml version="1.0" encoding="utf-8"?&gt;
  
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  
  
  
  
            &lt;!----line.xml-------------&gt;
  
  
                 &lt;?xml version="1.0" encoding="utf-8"?&gt;
         &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="horizontal"
  
      android:padding="5dip" &gt;
  
  
  
    &lt;ImageView android:id="@+id/icon"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:paddingLeft="10dp"
  
      /&gt;
  
  
      &lt;/RelativeLayout&gt;
  
  
      &lt;GridView 
          android:id="@+id/grid"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:horizontalSpacing="0pt"
          android:verticalSpacing="1pt"
          android:numColumns="3"
          android:gravity="center"
          &gt;&lt;/GridView&gt;
  
  
  
      &lt;/LinearLayout&gt;
  </code></pre>