【发布时间】:2016-12-29 01:49:12
【问题描述】:
我有一个西里尔文名称的文件:
File file = new File(cyr_name);
我尝试在另一个应用程序中打开它:
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file ), "text/plain");
startActivity(intent);
在 android 版本 6 中没有问题。 Android 7 出错:
28-12 20:54:25.018 21665 21665 E AndroidRuntime: android.os.FileUriExposedException: file:///storage/emulated/0/ws/%D0%9C%D0%B5%D1%82%D0%B5%D0%BB%D1%8C%D1%81%D0%BA%D0%B8%D0%B9_%D0%A3%D0%BD%D0%B5%D1%81%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9%20%D0%B2%D0%B5%D1%82%D1%80%D0%BE%D0%BC%20%D0%9A%D0%BD%D0%B8%D0%B3%D0%B0%20%D1%87%D0%B5%D1%82%D0%B2%D0%B5%D1%80%D1%82%D0%B0%D1%8F.txt exposed beyond app through Intent.getData()
7 安卓怎么了?
【问题讨论】:
标签: android file android-intent cyrillic