Access external storage in File Chooser

一笑奈何 提交于 2019-11-29 12:01:05
VicJordan

In the above github link you are using Environment.getExternalStorageDirectory() API which is working as expected. I think you misunderstood the use of this API. This API will always return the primary external storage directory. Below explanation may help you:

First of all, What is difference between Internal Storage, External Storage (aka primary external storage) and Secondary External Storage?

Internal Storage: is storage that is not accessible by the user, except via installed apps (or by rooting their device). Example: data/data/app_packageName

Primary External Storage: In built shared storage which is "accessible by the user by plugging in a USB cable and mounting it as a drive on a host computer". Example: When we say Nexus 5 32 GB.

Secondary External Storage: Removable storage. Example: SD Card.

Now next question. How to access SD card in Lollipop? To access SD card Android introduced new Storage Access Framework in KitKat.

Here is one answer explained it beautifully: https://stackoverflow.com/a/26765884/631803

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!