aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-04-27 15:35:47 -0700
committerScott Jackson <daneren2005@gmail.com>2014-04-27 15:35:47 -0700
commitab1fe3a2fd3778972b2b79a001a0b6f5398c2f63 (patch)
treec832439d369eaddaea2f6aa2eedcda990fffaf3c /src/github/daneren2005
parentec7e2d1638ec2742b3ce4598150a79acf7b0e632 (diff)
parenta7feb912db7066aaaac0f27870009326020897c1 (diff)
downloaddsub-ab1fe3a2fd3778972b2b79a001a0b6f5398c2f63.tar.gz
dsub-ab1fe3a2fd3778972b2b79a001a0b6f5398c2f63.tar.bz2
dsub-ab1fe3a2fd3778972b2b79a001a0b6f5398c2f63.zip
Merge branch 'SDCard'
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/util/FileUtil.java8
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);
}
}