lubritto / pdf_viewer_plugin

A Flutter plugin for IOS and Android providing a simple way to display PDFs.
MIT License
57 stars 65 forks source link

App crashes on android when clicking on a link, and nothing happens on iOS #29

Closed Hannnes1 closed 4 years ago

Hannnes1 commented 4 years ago

When you click on a link in a PDF document on an android phone, the following error appears and the app crashes:

D/AndroidRuntime(12273): Shutting down VM
E/AndroidRuntime(12273): FATAL EXCEPTION: main
E/AndroidRuntime(12273): Process: se.gotapps.brf, PID: 12273
E/AndroidRuntime(12273): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
E/AndroidRuntime(12273):    at android.app.ContextImpl.startActivity(ContextImpl.java:964)
E/AndroidRuntime(12273):    at android.app.ContextImpl.startActivity(ContextImpl.java:940)
E/AndroidRuntime(12273):    at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
E/AndroidRuntime(12273):    at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
E/AndroidRuntime(12273):    at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
E/AndroidRuntime(12273):    at com.github.barteksc.pdfviewer.link.DefaultLinkHandler.handleUri(DefaultLinkHandler.java:52)
E/AndroidRuntime(12273):    at com.github.barteksc.pdfviewer.link.DefaultLinkHandler.handleLinkEvent(DefaultLinkHandler.java:41)
E/AndroidRuntime(12273):    at com.github.barteksc.pdfviewer.listener.Callbacks.callLinkHandler(Callbacks.java:177)
E/AndroidRuntime(12273):    at com.github.barteksc.pdfviewer.DragPinchManager.checkLinkTapped(DragPinchManager.java:110)
E/AndroidRuntime(12273):    at com.github.barteksc.pdfviewer.DragPinchManager.onSingleTapConfirmed(DragPinchManager.java:73)
E/AndroidRuntime(12273):    at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:323)
E/AndroidRuntime(12273):    at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(12273):    at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(12273):    at android.app.ActivityThread.main(ActivityThread.java:7695)
E/AndroidRuntime(12273):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(12273):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/AndroidRuntime(12273):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
I/Process (12273): Sending signal. PID: 12273 SIG: 9
Lost connection to device.
Exited (sigterm)

Unfortunately I don't have the error (if any) for iOS right now, but when you click on a link there, nothing happens.

Hannnes1 commented 4 years ago

Duplicate of #15