Allow startup when no external storage is available.

This commit is contained in:
James Sanford 2013-02-16 19:55:04 -08:00
parent 5a957ec8ad
commit 0914d4ea51
1 changed files with 12 additions and 1 deletions

View File

@ -48,7 +48,18 @@ class ConfigFile {
}
public String[] getAllImageDirs() {
String externalStorage = Environment.getExternalStorageDirectory().getPath();
// Return an array of pathnames that may contain disk images.
// The pathnames may not actually exist, that is OK.
String externalStorage;
File externalDir = Environment.getExternalStorageDirectory();
if (externalDir != null) {
externalStorage = externalDir.getPath();
} else {
// Try harder. It is OK if this does not exist.
externalStorage = "/mnt/sdcard";
}
String[] dirs = {
getImagePath(),
externalStorage,