-1

if you're already know the images path like "/mnt/sdcard/newphoto"!how to using AsyncTask load
images from that path and fill with listview,

Goman
  • 13
  • 1
  • 9

1 Answers1

0

you can use this function in the AsyncTask<String><Void><Bitmap> within doInBackground:

 ArrayList<String> f = new ArrayList<String>();   // list of available files in  path
File[] listFile;

public void getSdcardImages()
{
File file= new File(android.os.Environment.getExternalStorageDirectory(),"MyFolder");

if (file.isDirectory())
{
    listFile = file.listFiles();


    for (int i = 0; i < listFile.length; i++)
    {

        f.add(listFile[i].getAbsolutePath());

    }
}
}

then in onPostExecute(Bitmap b) you can update the images

Coderji
  • 7,655
  • 5
  • 37
  • 51