简体   繁体   English

Android Access外部存储

[英]Android Access External Storage

I am facing some storage issue. 我正面临一些存储问题。 i am working on an application where i have to access phone's on board external storage and an External sdCard storage which i am getting with this code 我正在开发一个应用程序,我必须访问手机的外部存储和外部sdCard存储,我得到这个代码

Environment.getExternalStorageDirectory();

But when onBoard external memory exists then this code returns the path of onBoard memory not the external sdCard while the sdCard is mounted 但是当存在onBoard外部存储器时,此代码将返回onBoard内存的路径,而不是外部sdCard,同时安装了sdCard

now the problem is.. i want to access both memories onBoard and external sdcard is there any way to access both memories 现在的问题是..我想访问两个记忆onBoard和外部SD卡是否有任何方式来访问这两个记忆

Try out this: 试试这个:

String m_str = Environment.getExternalStorageDirectory()
               .getAbsolutePath().toString();           //return path sdcard/mnt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM