Created
March 3, 2012 10:14
-
-
Save SyncHack/1965375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File getTrueExternalStorageDirectory() { | |
final File standard = Environment.getExternalStorageDirectory(); | |
// SUMSUNG製品が他のどの製品よりも優れた独自仕様 | |
final File sd = new File(standard, "sd"); | |
final File ext = new File(standard, "external_sd"); | |
if (sd.exists() && sd.isDirectory()) | |
return sd; | |
else if (ext.exists() && ext.isDirectory()) | |
return ext; | |
return standard; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
元ネタ
http://toro.2ch.net/test/read.cgi/tech/1321864986/834
Androidプログラミング質問スレ Part15
このコードで通用するのはせいぜいAndroid 2.3.xまででAndroid 3.x以上だと厳しいと思われ。