Android Fileprovider: IllegalArgumentException: Failed to find configured root that contains

前端 未结 2 560
无人及你
无人及你 2021-02-13 05:04

I have a question about the android FileProvider. I want to save a pdf document and open it with a default program. I don´t want to save it in external Storage.

After I´

2条回答
  •  误落风尘
    2021-02-13 06:06

    According to your FileProvider file(XML), the second parameter is com.example.myApp.myActivity. That is

    Uri uri = FileProvider.getUriForFile(getApplicationContext(),
                                         "com.example.myApp.myActivity", pdf);
    

提交回复
热议问题