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

Move handler creation to onAttachedToWindow() instead of the constructor #824

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MimiReader
Copy link

Detaching and reattaching a PDFView causes an NPE. This is due to creating a handler in the constructor, but setting it to null in onDetachedFromWindow(). The fix is to create the handler on onAttachedToWindow() instead of the constructor.

This allows the view to be detached and re-attached without loss of functionality.

@wonday
Copy link

wonday commented Oct 9, 2019

+1
#822

@barsumek
Copy link

barsumek commented Mar 6, 2020

@barteksc could you merge this fix and create a new release please? It's a big blocker for people using your library in React Native: https://github.com/wonday/react-native-pdf 😿

polesapart added a commit to polesapart/AndroidPdfViewer that referenced this pull request Jul 11, 2020
@Shvet
Copy link

Shvet commented Feb 16, 2021

Is this update added in V3.2.0-beta.1? I am getting crash for this issue.

mhiew added a commit to mhiew/AndroidPdfViewer that referenced this pull request Dec 27, 2021
- the thread creation and recycling was not being handled symmetrically
- this fix is based off of these two PR: DImuthuUpe#824 and #2
AhmerAfzal1 added a commit to AhmerAfzal1/AhmerPdfium that referenced this pull request Feb 14, 2022
Fix a potential NPE due to out of sync render thread management [Pull Request](DImuthuUpe/AndroidPdfViewer#824)
Update the sample app configuration so that it can compile [Pull Request](mhiew/AndroidPdfViewer#2)
@alambd34
Copy link

alambd34 commented Mar 3, 2022

Please add new feature for autoCropPageMargin on bitmap blank space

facundofernandez added a commit to facundofernandez/AndroidPdfViewer that referenced this pull request Sep 13, 2024
- the thread creation and recycling was not being handled symmetrically
- this fix is based off of these two PR: DImuthuUpe#824 and mhiew#2
ref: DImuthuUpe@41f912e
facundofernandez added a commit to GoIntegro/AndroidPdfViewer that referenced this pull request Sep 16, 2024
- the thread creation and recycling was not being handled symmetrically
- this fix is based off of these two PR: DImuthuUpe#824 and mhiew#2
ref: DImuthuUpe/AndroidPdfViewer@41f912e
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

Successfully merging this pull request may close these issues.

9 participants