Open downloaded file on Android N using FileProvider

前端 未结 5 823
滥情空心
滥情空心 2021-02-05 17:11

I\'ve got to fix our App for Android N due to the FileProvider changes. I\'ve basically read all about this topic for the last ours, but no solution found did work out for me.

5条回答
  •  悲&欢浪女
    2021-02-05 18:12

    Can be this clearer solution ?

    Uri uriParser = Uri.parse(downloadedPackageUriString);
    File downloadedFile = new File(uriParser.getPath());
    

    before

    file:///storage/emulated/0/Download/ZS%20Gac%C3%ADkov%C3%A1.pdf

    after

    /storage/emulated/0/Download/ZS Gacíková.pdf

提交回复
热议问题