Start browsing from the android root directory if external storage isn't available

pull/14/head
Sam Bosley 14 years ago
parent 07e3046979
commit bf61577bd6

@ -50,7 +50,7 @@ public class FileExplore extends Activity {
public static final String EXTRA_DIRECTORIES_SELECTABLE = "directoriesSelectable"; //$NON-NLS-1$
private Item[] fileList;
private File path = new File(Environment.getExternalStorageDirectory().toString());
private File path;
private String chosenFile;
private static final int DIALOG_LOAD_FILE = 1000;
private String upString;
@ -64,6 +64,11 @@ public class FileExplore extends Activity {
super.onCreate(savedInstanceState);
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()))
path = new File(Environment.getExternalStorageDirectory().toString());
else
path = Environment.getRootDirectory();
loadFileList();
directoryMode = getIntent().getBooleanExtra(EXTRA_DIRECTORIES_SELECTABLE, false);

Loading…
Cancel
Save