private List<String> ReadSDCard()
{
List<String> tFileList = new ArrayList<String>();
//It have to be matched with the directory in SDCard
File f = new File("/sdcard/pictures/");
File[] files=f.listFiles();
for(int i=0; i<files.length; i++)
{
File file = files[i];
String curFile=file.getPath();
String ext=curFile.substring(curFile.lastIndexOf(".")+1,
curFile.length()).toLowerCase();
if(ext.equals("jpg")||ext.equals("gif")||ext.equals("png"))
tFileList.add(file.getPath());
}
return tFileList;
}
Next >> HelloGallery, get and display the path of selected picture
No comments:
Post a Comment