URI for your PDF file and pass it through the Intent Open PDF

 The error message you're seeing (FileUriExposedException) occurs because starting from Android 7.0 (API level 24), file:// URIs are no longer allowed to be passed to other applications via Intent. This is a security measure to prevent exposing sensitive files to other apps.

Step 1 :

Go to app -> src -> main -> AndroidManifest.xml.

Step 2:

Copy following code:

  1. In your AndroidManifest.xml file, ensure that you have defined the FileProvider correctly:

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.