在Android 6.0中获取外部存储路径?

问题描述 投票:0回答:1

我使用的是棉花糖版本的moto g手机,我想获取我的外部存储卡的路径,但是我只能访问内部存储器(在为棉花糖写了一些权限之后),我尝试了如下所示的多种组合进行访问外部存储卡

     sdpath="/storage/sdcard1";
     sdpath="/storage/extSdCard";
     sdpath="/storage/usbcard1";
     sdpath=System.getenv("SECONDARY_STORAGE");

我已通过写入sdpath =“ / storage / emulated / 0”访问内部存储器;但无法通过上述代码访问外部存储卡,因为谷歌已更改了从android 6.0的访问权限,因此我如何在android棉花糖中访问存储卡,在此先感谢您的宝贵答复。

android android-6.0-marshmallow android-external-storage
1个回答
1
投票

我如何在android棉花糖中访问存储卡

© www.soinside.com 2019 - 2024. All rights reserved.