title: How to show images in list view that are stored in my SD Card particular location
body: <p>I have created an app in which I had use SPenSDK to create image using canvasView. Once I create images in the canvas view, I save the image in the SD Card <code>/mnt/sdcard/SmemoExample</code> location. Now I want to display all the images that are stored here <code>/mnt/sdcard/SmemoExample</code> in my ListView.</p>
  <p>But I am not able to find any solution for that.</p>
  <p><strong>List_view.xml file</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:orientation=&quot;vertical&quot;
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;fill_parent&quot;&gt;
  &lt;ListView
      android:id=&quot;@+id/list&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot; 
      android:layout_weight=&quot;1&quot;/&gt;
  &lt;Button
      android:id=&quot;@+id/button1&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;wrap_content&quot; 
      android:text=&quot;Clear Cache&quot;/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>item.xml file</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout
  xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;wrap_content&quot;&gt;
  &lt;ImageView
    android:id=&quot;@+id/image&quot;
    android:layout_width=&quot;50dip&quot;
    android:layout_height=&quot;50dip&quot; android:src=&quot;@drawable/ic_launcher&quot;   android:scaleType=&quot;centerCrop&quot;/&gt;
  &lt;TextView
    android:id=&quot;@+id/text&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:layout_weight=&quot;1&quot; android:layout_gravity=&quot;left|center_vertical&quot; android:textSize=&quot;20dip&quot; android:layout_marginLeft=&quot;10dip&quot;/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>java code</strong></p>
  <pre><code>public class ListActivity extends Activity {
  private String[] mFileStrings;
  
  private File[] listFile;
  
  ListView list;
  
  ImageAdapter adapter;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      
       File file = new File(CanvasActivity.DEFAULT_APP_IMAGEDATA_DIRECTORY);
       
       if (file.isDirectory()) {
           listFile = file.listFiles();
           mFileStrings = new String[listFile.length];
  
           for (int i = 0; i &lt; listFile.length; i++) {
               mFileStrings[i] = listFile[i].getAbsolutePath();
           }
       }
  
       list = (ListView) findViewById(R.id.list);
       adapter = new ImageAdapter(this, mFileStrings);
       list.setAdapter(adapter);
  }
  
  public class ImageAdapter extends BaseAdapter {
      private Activity activity;
      private String[] data;
      private LayoutInflater inflater=null;
      public ImageLoader imageLoader; 
      
      public ImageAdapter(Activity a, String[] d) {
          activity = a;
          data=d;
          inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          imageLoader=new ImageLoader(activity.getApplicationContext());
      }
  
      public int getCount() {
          return data.length;
      }
  
      public Object getItem(int position) {
          return position;
      }
  
      public long getItemId(int position) {
          return position;
      }
      
      public View getView(int position, View convertView, ViewGroup parent) {
          View vi=convertView;
          if(convertView==null)
              vi = inflater.inflate(R.layout.item, null);
  
          TextView text=(TextView)vi.findViewById(R.id.text);;
          ImageView image=(ImageView)vi.findViewById(R.id.image);
          text.setText(&quot;item &quot;+position);
          imageLoader.DisplayImage(data[position], image);
          return vi;
      }
  }
  }
  </code></pre>