I have created a folder on sdcard for storing different type of files.
Now, i just need to show all file on click of application icon.
Can anyone provide me correct source code for this ?
Its urgent !!
Thanks in Advance !!
I have created a folder on sdcard for storing different type of files.
Now, i just need to show all file on click of application icon.
Can anyone provide me correct source code for this ?
Its urgent !!
Thanks in Advance !!
你只是想要一个清单吗?
File directory = getMyDirectory(); // do this however you want
File[] files = directory.listFiles(); // gets an array of files in the dir.
public void directoryPath(File path) {
// TODO Auto-generated method stub
if( path.exists() ) {
File[] files = path.listFiles();
for(int i=0; i<files.length; i++) {
//you can do what you want here
}
}
}
上面的代码给出了文件夹中的所有文件......