Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit e086e9a

Browse files
committed
Fix Android SDCard path constant #174
1 parent 8215f07 commit e086e9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ static public Map<String, Object> getSystemfolders(ReactApplicationContext ctx)
197197
res.put("DownloadDir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath());
198198
res.put("MovieDir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES).getAbsolutePath());
199199
res.put("RingtoneDir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES).getAbsolutePath());
200-
// res.put("SDCard", Environment.getExternalStorageDirectory().getAbsolutePath());
200+
String state;
201+
state = Environment.getExternalStorageState();
202+
if (state.equals(Environment.MEDIA_MOUNTED)) {
203+
res.put("SDCard", Environment.getExternalStorageDirectory().getAbsolutePath());
204+
}
201205
res.put("MainBundleDir", ctx.getApplicationInfo().dataDir);
202206
return res;
203207
}

0 commit comments

Comments
 (0)