0

I'm having problems with PDFRenderer not changing the PDF it shows after the first run of the application, no matter what I do.

I'm using the code from the official PDFRenderer Sample from https://developer.android.com/samples/PdfRendererBasic/project.html and Android Studio.

Exact steps I take which can be used to replicate this:

  1. Add 2 files to Application/src/main/assets: PDF_1.pdf and PDF_2.pdf
  2. In PdfRendererBasicFragment.java, line 140 in function openRenderer, change

    mFileDescriptor = context.getAssets().openFd("sample.pdf").getParcelFileDescriptor();
    

    to

    mFileDescriptor = context.getAssets().openFd("PDF_1.pdf").getParcelFileDescriptor();
    
  3. Run project; Everything works as expected

  4. In code above, change "PDF_1.pdf" to "PDF_2.pdf"
  5. Run project again; The application still shows PDF_1.pdf

I have tried starting a completely new emulator, removing PDF_1.pdf from assets folder, syncronizing assets and "clean / rebuild project" in Android Studio , but it still keeps displaying PDF_1.pdf after the first run.

nkorth
  • 1,684
  • 1
  • 12
  • 28
Gerto
  • 26
  • 2

0 Answers0