I'm happy reading and writing to a pre-set file, and could manually populate a listview, but I'm hoping there is an official(or not) filebrowser I missed, or other more elegant solution to present the user with a directory listing, and let them select a file.
final String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
File[] files = Environment.getExternalStorageDirectory().listFiles();
} else {
...
}
File fileList = new File("/sdcard");
if (fileList != null){
File[] filenames = fileList.listFiles();
for (File tmpf : filenames){
//Do something with the files
}
}
}
Is another method you can try
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With