简体   繁体   English

android kitkat 4.4问题中的sd卡访问

[英]sd card access in android kitkat 4.4 issue

I have been able to find path of both internal and external sd cards on device. 我已经能够找到设备上内部和外部SD卡的路径。 Everything runs fine but only on devices prior to 4.4. 一切正常,但只能在4.4之前的设备上运行。

When I test the code on 4.4.x device I can't access a file I have to upload from external sd card. 当我在4.4.x设备上测试代码时,我无法访问必须从外部SD卡上传的文件。

How to solve this 如何解决这个问题

First identify which file you want from memory then use like this. 首先确定您要从内存中选择哪个文件,然后像这样使用。


        Intent pictureActionIntent = new Intent(Intent.ACTION_GET_CONTENT, null);
        pictureActionIntent.setType("image/*");
        pictureActionIntent.putExtra("return-data", true);
        startActivityForResult(pictureActionIntent, 0);

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

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