Skip to content

Instantly share code, notes, and snippets.

@fida1989
Created January 9, 2018 10:43
Show Gist options
  • Save fida1989/f5b00f74411ddb14cf8231cfb3f9d34b to your computer and use it in GitHub Desktop.
Save fida1989/f5b00f74411ddb14cf8231cfb3f9d34b to your computer and use it in GitHub Desktop.
public String getCardPath() {
String removableStoragePath = "";
File fileList[] = new File("/storage/").listFiles();
for (File file : fileList) {
if (!file.getAbsolutePath().equalsIgnoreCase(Environment.getExternalStorageDirectory().getAbsolutePath()) && file.isDirectory() && file.canRead()) {
removableStoragePath = file.getAbsolutePath();
}
}
return removableStoragePath;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment