how to customize gridview please help me
<p>this is my code below which load filepath in gridview if is directory show icon otherwise show images is work fine  but i used simpleAdapter i want to add checkbox in gridView i found this example code <a href="http://www.thaicreate.com/mobile/android-gridview-checkbox.html" rel="nofollow">http://www.thaicreate.com/mobile/android-gridview-checkbox.html</a>
i alo paste this example code below how do i customize my code acording to that code? i called this function in my code inflateListView(); how do i customize this function the eample code is work fine but example code load File as string also not diffenciate file or file path my code is diffrenciate i just want to use this example code in my function
inflateListView();.</p>

<pre><code>   root1 = new File("/data/data/com.myexample/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
   /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;!---------EXAMPLE  CODE- BELOW---------------------&gt;&gt;&gt;&gt;&gt;&gt;&gt;







     package com.example.gridviewfilepath;


  import android.graphics.BitmapFactory;

  public class MainActivity extends Activity {

  List &lt;String&gt; ImageList;

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

 /*** Get Images from SDCard ***/
  ImageList = getSD();

  // gridView1
  final GridView gView1 = (GridView)findViewById(R.id.gridView1);

   gView1.setAdapter(new ImageAdapter(this,ImageList));


  // Check All
  Button btnCheckAll = (Button) findViewById(R.id.btnCheckAll);
  btnCheckAll.setOnClickListener(new OnClickListener() {
   public void onClick(View v) {
  int count = gView1.getAdapter().getCount();
  for (int i = 0; i &lt; count; i++) {
  LinearLayout itemLayout = (LinearLayout)gView1.getChildAt(i); // Find by under     
  LinearLayout
  CheckBox checkbox = (CheckBox)itemLayout.findViewById(R.id.checkBox1);
 checkbox.setChecked(true);
 } 
 }
 });

 // Clear All
 Button btnClearAll = (Button) findViewById(R.id.btnClearAll);
 btnClearAll.setOnClickListener(new OnClickListener() {
 public void onClick(View v) {
 int count = gView1.getAdapter().getCount();
 for (int i = 0; i &lt; count; i++) {
 LinearLayout itemLayout = (LinearLayout)gView1.getChildAt(i); 
  // Find by under         LinearLayout
 CheckBox checkbox = (CheckBox)itemLayout.findViewById(R.id.checkBox1);
 checkbox.setChecked(false);
  } 
 }
 });

 // Get Item Checked
  Button btnGetItem = (Button) findViewById(R.id.btnGetItem);
  btnGetItem.setOnClickListener(new OnClickListener() {
  public void onClick(View v) {
  int count = gView1.getAdapter().getCount();
  for (int i = 0; i &lt; count; i++) {
  LinearLayout itemLayout = (LinearLayout)gView1.getChildAt(i); // Find by under     
 LinearLayout
  CheckBox checkbox = (CheckBox)itemLayout.findViewById(R.id.checkBox1);
   if(checkbox.isChecked())
  {
 Log.d("Item "+String.valueOf(i), checkbox.getTag().toString());

 Toast.makeText(MainActivity.this,checkbox.getTag().toString()  
,Toast.LENGTH_LONG).show(); 
}
 } 
}
 });

 }

  private List &lt;String&gt; getSD()
 {
  List &lt;String&gt; it = new ArrayList &lt;String&gt;();
 File f = new File ("/mnt/sdcard/");
 //File f = new File ("/data/data/com.newsoftwares.folderlock/files/photos");


 File[] files = f.listFiles ();

 for (int i = 0; i &lt;files.length; i++)
 {
   File  file = files[i];
  Log.d("Count",file.getPath());
  it.add (file.getPath());
 }
 return it;
 }

 public class ImageAdapter extends BaseAdapter
 {
 private Context context;
  private List &lt;String&gt; lis;

  public ImageAdapter(Context c, List &lt;String&gt; li)
  {
 // TODO Auto-generated method stub
  context = c;
  lis = li;
  }

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

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

 public long getItemId(int position) {
 // TODO Auto-generated method stub
  return position;
 }

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

  LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

 if (convertView == null) {
    convertView = inflater.inflate(R.layout.showimage, null);
 }
 TextView textView = (TextView) convertView.findViewById(R.id.textView1);
  String strPath = lis.get(position).toString();

// Get File Name
String fileName = strPath.substring( strPath.lastIndexOf('/')+1, strPath.length() );
  textView.setText(fileName);

 // Image Resource
ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView1);
 Bitmap bm = BitmapFactory.decodeFile(strPath);
 imageView.setImageBitmap(bm);

 // CheckBox
  CheckBox Chkbox = (CheckBox) convertView.findViewById(R.id.checkBox1);
 Chkbox.setTag(fileName);

 return convertView;

}
}


 @Override
  public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
 return true;
}

}
</code></pre>
