I am using the below code for implementing the code with File Provider. In this, I have use the AndroidJavaClass and AndroidObjectClass to open a pdf. I have also set the file p