Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not rendering in Recyclerview #3

Open
sssvrock opened this issue Feb 9, 2017 · 2 comments
Open

Not rendering in Recyclerview #3

sssvrock opened this issue Feb 9, 2017 · 2 comments

Comments

@sssvrock
Copy link

sssvrock commented Feb 9, 2017

Hi @barteksc ,

In general PDF contains more papers, in my case I am rendering single page with <com.github.barteksc.pdfviewer.PDFView>

I am displaying Each PDF file in Recyclerview using Adapter, so I can do load more for each pdf file it makes user comfort of rendering of pdf files.

While I m scrolling down the property of recyclerview is reusing the the views so at that time Pdfium core is distroyed and it is not at all rendering in scrolldown.

Here is logcat:

D/Error: 480.0
02-09 15:42:12.534 20576-20576/com.self.pdf_poc D/Error: 480.0
02-09 15:42:12.582 20576-20576/com.self.pdf_poc D/Error: 480.0
02-09 15:42:12.614 20576-20576/com.self.pdf_poc D/Error: 480.0
02-09 15:42:15.054 20576-20576/com.self.pdf_poc D/jniPdfium: Destroy FPDF library
02-09 15:42:20.513 20576-20576/com.self.pdf_poc D/AndroidRuntime: Shutting down VM
02-09 15:42:20.529 20576-20576/com.self.pdf_poc E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.self.pdf_poc, PID: 20576
java.lang.NullPointerException: Attempt to read from field 'long com.shockwave.pdfium.PdfDocument.mNativeDocPtr' on a null object reference
at com.shockwave.pdfium.PdfiumCore.openPage(PdfiumCore.java:134)
at com.github.barteksc.pdfviewer.PDFView.loadPage(PDFView.java:706)
at com.github.barteksc.pdfviewer.PDFView.loadPages(PDFView.java:664)

How can I achieve my solution. Please let me know it's urgent

Thanks

@sssvrock
Copy link
Author

Hi @barteksc Any update on recyclerview rendering.

because after this successful implementation I can move further. Let me know if you need more clarity on what I am doing.

Regards
Vinod

@sssvrock
Copy link
Author

Here is Log cat:

When I am scrolling from top to bottom and bottom to top using recyclerview:

E/com.shockwave.pdfium.PdfiumCore: mContext may be null
02-14 12:59:13.952 28809-29025/com.self.pdf_poc W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
02-14 12:59:13.952 28809-29025/com.self.pdf_poc W/System.err: at com.shockwave.pdfium.PdfiumCore.renderPageBitmap(PdfiumCore.java:229)
02-14 12:59:13.952 28809-29025/com.self.pdf_poc W/System.err: at com.github.barteksc.pdfviewer.RenderingHandler.proceed(RenderingHandler.java:91)
02-14 12:59:13.952 28809-29025/com.self.pdf_poc W/System.err: at com.github.barteksc.pdfviewer.RenderingHandler.handleMessage(RenderingHandler.java:70)
02-14 12:59:13.952 28809-29025/com.self.pdf_poc W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
02-14 12:59:13.952 28809-29025/com.self.pdf_poc W/System.err: at android.os.Looper.loop(Looper.java:148)
02-14 12:59:13.952 28809-29025/com.self.pdf_poc W/System.err: at android.os.HandlerThread.run(HandlerThread.java:61)
02-14 12:59:14.983 28809-29025/com.self.pdf_poc E/com.shockwave.pdfium.PdfiumCore: mContext may be null
02-14 12:59:14.983 28809-29025/com.self.pdf_poc W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
02-14 12:59:14.983 28809-29025/com.self.pdf_poc W/System.err: at com.shockwave.pdfium.PdfiumCore.renderPageBitmap(PdfiumCore.java:229)
02-14 12:59:14.983 28809-29025/com.self.pdf_poc W/System.err: at com.github.barteksc.pdfviewer.RenderingHandler.proceed(RenderingHandler.java:91)
02-14 12:59:14.983 28809-29025/com.self.pdf_poc W/System.err: at com.github.barteksc.pdfviewer.RenderingHandler.handleMessage(RenderingHandler.java:70)
02-14 12:59:14.983 28809-29025/com.self.pdf_poc W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
02-14 12:59:14.983 28809-29025/com.self.pdf_poc W/System.err: at android.os.Looper.loop(Looper.java:148)
02-14 12:59:14.983 28809-29025/com.self.pdf_poc W/System.err: at android.os.HandlerThread.run(HandlerThread.java:61)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant