diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-04-27 15:35:47 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-04-27 15:35:47 -0700 |
commit | ab1fe3a2fd3778972b2b79a001a0b6f5398c2f63 (patch) | |
tree | c832439d369eaddaea2f6aa2eedcda990fffaf3c /src/github | |
parent | ec7e2d1638ec2742b3ce4598150a79acf7b0e632 (diff) | |
parent | a7feb912db7066aaaac0f27870009326020897c1 (diff) | |
download | dsub-ab1fe3a2fd3778972b2b79a001a0b6f5398c2f63.tar.gz dsub-ab1fe3a2fd3778972b2b79a001a0b6f5398c2f63.tar.bz2 dsub-ab1fe3a2fd3778972b2b79a001a0b6f5398c2f63.zip |
Merge branch 'SDCard'
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/util/FileUtil.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java index dc3a1a71..e9c5444b 100644 --- a/src/github/daneren2005/dsub/util/FileUtil.java +++ b/src/github/daneren2005/dsub/util/FileUtil.java @@ -315,9 +315,13 @@ public class FileUtil { public static File getDefaultMusicDirectory(Context context) { if(DEFAULT_MUSIC_DIR == null) { File[] dirs = ContextCompat.getExternalFilesDirs(context, null); - DEFAULT_MUSIC_DIR = new File(dirs[dirs.length - 1], "music"); + if(Util.isExternalStoragePresent()) { + DEFAULT_MUSIC_DIR = new File(dirs[dirs.length - 1], "music"); + } else { + DEFAULT_MUSIC_DIR = new File(context.getExternalFilesDir(null), "music"); + } if (!DEFAULT_MUSIC_DIR.exists() && !DEFAULT_MUSIC_DIR.mkdirs()) { - Log.e(TAG, "Failed to create " + "music"); + Log.e(TAG, "Failed to create default dir " + DEFAULT_MUSIC_DIR); } } |