0
我有西里爾名稱的文件:Android的7打開文件西里爾名
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?
謝謝!謝謝! – SmallSani