How to open a PDF stored in Internal Memory

后端 未结 2 1656
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 17:02

I have an App that downloads a PDF file and stores it with MODE_PRIVATE (for security purposes) on the Internal Memory of the App:

FileOutputStream fos = get         


        
2条回答
  •  攒了一身酷
    2021-01-18 17:42

    To make a file from internal storage available to other apps the cleanest approach is to use a content provider. Luckily, Android comes with FileProvider – an implementation that might just serve your needs. You don't need to implement code (contrary to the approach of @CommonsWare), you just need to specifiy the provider in your manifest.

提交回复
热议问题