Hello!
I'm having some issues when trying to open hyperlinks in SfPdfViewer.
I have the 'AllowHyperlinkNavigation' property set to true and I'm also watching the 'HyperlinkClicked' event.
The event is getting the correct uri as expected, but my app is crashing when leaving this method.
It seems that it crashes when trying to open a Dialog.
Is there any way I can open the hyperlink in browser just with the 'HyperlinkClicked' event, without needing this Dialog?
Let me show the error I'm getting next.
Thanks in advance,
Nilo Basilio
Android.Views.WindowManagerBadTokenException: Unable to add window -- token android.os.BinderProxy@d427582 is not valid; is your activity running?
at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in :0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in :0
at Android.App.Dialog.Show () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-30/mcw/Android.App.Dialog.cs:2758
at Syncfusion.SfPdfViewer.XForms.Droid.LinearLayoutEx.HyperlinkAnnotationButton (System.String annotationUri, Xamarin.Forms.Rectangle annotationBounds, System.Int32 pageIndex) [0x00102] in <3d17a5c6caae4c3f801c757548271008>:0
at Syncfusion.SfPdfViewer.XForms.Droid.GestureDetectorEx.OnSingleTapConfirmed (Android.Views.MotionEvent e) [0x000f0] in <3d17a5c6caae4c3f801c757548271008>:0
at Android.Views.GestureDetector+SimpleOnGestureListener.n_OnSingleTapConfirmed_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00010] in /Users/builder/azdo/_work/1/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-30/mcw/Android.Views.GestureDetector.cs:1307
at at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.121(intptr,intptr,intptr)
at android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@d427582 is not valid; is your activity running?
at at android.view.ViewRootImpl.setView(ViewRootImpl.java:977)
at at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:416)
at at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:102)
at at android.app.Dialog.show(Dialog.java:419)
at at crc64f0d106695cb1f69e.GestureDetectorEx.n_onSingleTapConfirmed(Native Method)
at at crc64f0d106695cb1f69e.GestureDetectorEx.onSingleTapConfirmed(GestureDetectorEx.java:38)
at at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:323)
at at android.os.Handler.dispatchMessage(Handler.java:107)
at at android.os.Looper.loop(Looper.java:214)
at at android.app.ActivityThread.main(ActivityThread.java:7615)
at at java.lang.reflect.Method.invoke(Native Method)
at at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)