I have pdfview in a fragment. The fragment calls its parent activity when it is created to download a pdf file if necessary and then the activity calls a method in the fragment to actually load the file into pdfview.
I have recently migrated to sdk30 and androidx.lifecycle 2.3 and have faced some weird behavior.
If the fragment calls the activity via onActivityCreated then everything works well. Bu if it does it via the new LifecycleObserver way then pdfview crashes with NullPointerException. It's also worth noting that it starts crashing only after a file was loaded into pdfview once.
I have pdfview in a fragment. The fragment calls its parent activity when it is created to download a pdf file if necessary and then the activity calls a method in the fragment to actually load the file into pdfview.
I have recently migrated to sdk30 and androidx.lifecycle 2.3 and have faced some weird behavior. If the fragment calls the activity via onActivityCreated then everything works well. Bu if it does it via the new LifecycleObserver way then pdfview crashes with NullPointerException. It's also worth noting that it starts crashing only after a file was loaded into pdfview once.