Using some pretty simple android code I am trying to access a folder according to the following logic:
public void try_to_navigate_local_dir(){
Environment e = new Environment();
ArrayList<String> filesList = new ArrayList<String>();
String sd_card = Environment.getExternalStorageDirectory().toString() + "/subdir_x";
File file = new File( sd_card ) ;
File list[] = file.listFiles();
for( int i=0; i< list.length; i++) {
filesList.add( list[i].getName() );
}
}
Where subdir_x
is created by another application on my phone.
I can view in those folders using file manager, yet my code returns null when I try to file.listFiles()
.
How may I access these files?