2013-08-02 65 views
0

我得到了外部和内部(手机内存)SD卡在我的应用 列表中,但随着我有更多的文件夹,我不想他们,所以我怎么能限制外部和内部SD卡只在上市...获取外部SD卡在Android手机

我提供的根目录是/storage并显示整个文件夹...

,或者可以有一个人告诉我怎么弄programmaticaly外置SD卡

我已经试过通常的方式File file = Environment.getExternalStorageDirectory();

由android给出,但它只返回内部路径。

+0

http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory下更好( )。检查'getExternalStorageDirectory()'下的文档和注释。 – Raghunandan

+0

不可能它会返回外部路径 –

+0

你得到的其他文件夹应该只是USB驱动器......你应该能够使用(file.length()> 0)和/或file.canRead()来过滤它们。在这里阅读我的答案:http://stackoverflow.com/questions/11281010/how-can-i-get-external-sd-card-path-for-android-4-0/19831522 –

回答