Rg.plugins.popup: CloseWhenBackgroundIsClicked not works on Android with Xamarin.Forms 2.4.0.280

Created on 28 Sep 2017  Â·  92Comments  Â·  Source: rotorgames/Rg.Plugins.Popup

The popup does not close when Background click on Android with Xamarin.Forms 2.4.0.280. This works with version 2.3.x.

bug confirmed fixed priority-high

Most helpful comment

Hi there. Thank you for your questions and supporting. I'm so sorry that I have not updated this library a lot of time. I will review this PR soon, and I will try to update this library soon.

All 92 comments

+1

I am also noticing this issue but only on Release builds after updating to XF 2.4.x but it works in Debug builds...

  • 1

+1 Happens on Debug and Release

+1 yes also noticing this on both debug and release with XF 2.4.x

This problem can be fixed if the Click event in the Android renderer is changed to Touch event.

`
protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);

        if (e.NewElement != null)
        {
            this.Touch += OnBackgroundTouch;
        }

        if (e.OldElement != null)
        {
            this.Touch -= OnBackgroundTouch;
        }
    }

`
I hope this will help you.

I already created PR. @rotorgames I think that you are quite busy but could you please push this important update for us?

I think that the proposed solution is not the right one:
The touch intercept also the events coming from a children stacklayout (for example in the UserAnimation demo, the touch is intercept also if you tap on the grey background where is written "user animation".
And also the touch event is called twice, for mousedown and for mouseup.
I still try to find a solution, because i need xamarin.forms 2.4....

yes also recognized that it is not a solution for UWP desktop as well. This error occurs in every platform I guess, not only Android (Havent tested IOS yet)

@rotorgames can you please let us know, when we might possibly getting a fix for this issue. currently using Nuget ver. 1.0.4

Was told to move to version 1.1.0-pre1 to resolve a different issue.
Xamarin.Forms 2.4.0.282

I'm noticing the opposite problem. CloseWhenBackgroundIsClicked="False" in XAML and in C#- but the popup IS closing when the background is clicked.

I need it to NOT close when background is clicked.

it looks like that this project is no longer supported. maybe somebody can make a copy and handle it on separate repository because we need to work with it further. we have live apps in the store.

Why do you think the project is abandoned? If you look at the closed issues, the last one was closed just 21 days ago. That doesn't feel 'no longer supported' to me. Maybe its just that bug fixes for one version are lower priority than finishing up a major revision that would wrap such issues - as an example.

@tlhintoq closed issues can be closed by the OP and it was. you can clearly see that last commit was done 4 months ago and last answer from the creator of the project was 4 months ago as well. Creator was super quick in response time earlier. you will get a response with in 24h before June. I hope that he is doing fine but it looks like Project is abandoned.

All good points. That's why I asked what lead you to that conclusion. I didn't dig as deeply as you did. Thanks for the details.

@rotorgames As @EmilAlipiev says "Hope you're okay". Could you let folks know if you're still around?

+1

We should get this useful functionality baked right in the framework. Show your support for the idea here https://forums.xamarin.com/discussion/105094/popups-with-custom-content The many replies you do there, the more attention it attracts.

+1

Hi there. Thank you for your questions and supporting. I'm so sorry that I have not updated this library a lot of time. I will review this PR soon, and I will try to update this library soon.

That's the best news I've heard all week! I can go into the weekend with a smile on my face.

we are glad that you doing fine :)

Nice to hear

Le 20 oct. 2017 6:34 PM, "EmilAlipiev" notifications@github.com a écrit :

we are glad that you doing fine :)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/rotorgames/Rg.Plugins.Popup/issues/173#issuecomment-338257741,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH-ezS4UR2x5V4Ja4Q0SJnQZtxoJoTo6ks5suMuegaJpZM4PnCWS
.

For what it's worth, this is also happens on IPad Mini 4 running iOS 11.
XF 2.3.5.256-pre6

@gcadmes Did you try to test my the last changes e76d28da8ada296b3f00d59057c851e96bbd2b4d?

@gcadmes With the same Ipad and iOS version it works great for me. Check
your content you cannot have a layout or something catching events.

Le 21 oct. 2017 9:12 AM, "Kirill" notifications@github.com a écrit :

@gcadmes https://github.com/gcadmes Did you try to test my the last
changes e76d28d
https://github.com/rotorgames/Rg.Plugins.Popup/commit/e76d28da8ada296b3f00d59057c851e96bbd2b4d
?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/rotorgames/Rg.Plugins.Popup/issues/173#issuecomment-338369900,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH-ezdyqrM0LICYqh6xb5Lz1UcOm_FNPks5suZlFgaJpZM4PnCWS
.

I have published v1.1.0-pre3. You can test it.

Fix doesn't work, @rotorgames , the popup is not shown and the app crashes after a few time opening popups.
Tested on Android
Popup-Plugin Version: v1.1.0-pre3
Xamarin.Forms Version: 2.4.0.282

Same issue in prerelease 2, version v1.1.0-pre1 works without crashing and without popup closing

Heres the Stacktrace if you need it:

10-23 12:39:33.000 I/MonoDroid( 4444): Java.Lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
10-23 12:39:33.000 I/MonoDroid( 4444):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <e499a5498b1b48379b88fe5ed629079f>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <e499a5498b1b48379b88fe5ed629079f>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Android.Views.ViewGroup.AddView (Android.Views.View child) [0x00031] in <2e14bb2dd93a405e81838369ed72695b>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Rg.Plugins.Popup.Droid.Impl.PopupNavigationDroid.AddPopup (Rg.Plugins.Popup.Pages.PopupPage page) [0x00034] in <cf10a5a1e63740219e90aa2d1599c262>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Rg.Plugins.Popup.Services.PopupNavigation.PushAsync (Rg.Plugins.Popup.Pages.PopupPage page, System.Boolean animate) [0x00043] in <e4a0d036d16d43a8a07fbef673df812b>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Rg.Plugins.Popup.Extensions.NavigationExtension.PushPopupAsync (Xamarin.Forms.INavigation sender, Rg.Plugins.Popup.Pages.PopupPage page, System.Boolean animate) [0x00000] in <e4a0d036d16d43a8a07fbef673df812b>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at AppBDE.pro.Views.CostumViews.NavigationTileView`1+<TileClicked>d__12[T].MoveNext () [0x000b5] in C:\Development\Git\Product\Mobile\AppBDE.pro\src\AppBDE.pro\AppBDE.pro\Views\CostumViews\NavigationTileView.cs:85 
10-23 12:39:33.000 I/MonoDroid( 4444): --- End of stack trace from previous location where exception was thrown ---
10-23 12:39:33.000 I/MonoDroid( 4444):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <2e14bb2dd93a405e81838369ed72695b>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <2e14bb2dd93a405e81838369ed72695b>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <2e14bb2dd93a405e81838369ed72695b>:0 
10-23 12:39:33.000 I/MonoDroid( 4444):   at (wrapper dynamic-method) System.Object:fb349df0-902d-4744-a3d4-acd705ab92d8 (intptr,intptr)
10-23 12:39:33.000 I/MonoDroid( 4444):   --- End of managed Java.Lang.IllegalStateException stack trace ---
10-23 12:39:33.000 I/MonoDroid( 4444): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
10-23 12:39:33.000 I/MonoDroid( 4444):  at android.view.ViewGroup.addViewInner(ViewGroup.java:4309)
10-23 12:39:33.000 I/MonoDroid( 4444):  at android.view.ViewGroup.addView(ViewGroup.java:4145)
10-23 12:39:33.000 I/MonoDroid( 4444):  at android.view.ViewGroup.addView(ViewGroup.java:4086)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.addView(ViewGroup.java:4059)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.InnerGestureListener.n_onSingleTapUp(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.GestureDetector.onTouchEvent(GestureDetector.java:635)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_onTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.onTouchEvent(Platform_DefaultRenderer.java:46)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.View.dispatchTouchEvent(View.java:9294)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2547)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2240)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2575)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.dispatchTouchEvent(VisualElementRenderer_1.java:64)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.dispatchTouchEvent(VisualElementRenderer_1.java:64)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.n_dispatchTouchEvent(Native Method)
10-23 12:39:33.001 I/MonoDroid( 4444):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.dispatchTouchEvent(PlatformRenderer.java:55)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.001 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
10-23 12:39:33.002 I/MonoDroid( 4444):  at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
10-23 12:39:33.002 I/MonoDroid( 4444):  at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.app.Activity.dispatchTouchEvent(Activity.java:2765)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:71)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:71)
10-23 12:39:33.002 I/MonoDroid( 4444):  at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.View.dispatchPointerEvent(View.java:9514)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4230)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4096)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5922)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5896)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5857)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6025)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.os.MessageQueue.nativePollOnce(Native Method)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.os.MessageQueue.next(MessageQueue.java:323)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.os.Looper.loop(Looper.java:135)
10-23 12:39:33.002 I/MonoDroid( 4444):  at android.app.ActivityThread.main(ActivityThread.java:5417)
10-23 12:39:33.002 I/MonoDroid( 4444):  at java.lang.reflect.Method.invoke(Native Method)
10-23 12:39:33.002 I/MonoDroid( 4444):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-23 12:39:33.002 I/MonoDroid( 4444):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

@kayjoekahmann this is other problem. This issues has been fixed.

Did you remove a popup page before invoking PushPopupAsync method?

No i didn't pop a popup before

@kayjoekahmann You can't use one instance few times. You should do pop before using instance of popup page.

I don't use the same instance multiple times. But the problem ist that the popup isn't shown after update to v1.1.0-pre1 an higher

@kayjoekahmann show your code

P.S. Maybe your method is invoked several times? Set breakpoint and check it.

XAML Code:

<?xml version="1.0" encoding="utf-8" ?>
<pages:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
             xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
             x:Class="AppBDE.pro.Pages.EmployeeIdPopupPage" >
    <pages:PopupPage.Animation>
        <animations:ScaleAnimation
      PositionIn="Bottom"
      PositionOut="Center"
      ScaleIn="1"
      ScaleOut="0.7"
      DurationIn="700"/>
    </pages:PopupPage.Animation>
    <ScrollView
    HorizontalOptions="Center"
    VerticalOptions="Center">
        <AbsoluteLayout>
          <Frame
      x:Name="FrameContainer"
      Margin="15"
      HorizontalOptions="Center"
      BackgroundColor="White">
            <Grid >
              <Label Text="Mitarbeiter Id:" VerticalOptions="Center"
                     Grid.Row="0" Grid.Column="0"/>
              <Entry x:Name="_idEntry" Placeholder="ID" Text="{Binding EmployeeId}"
                     Grid.Row="0" Grid.Column="1"/>
              <Button Text="Bestätigen" Clicked="OnIdConfirmClicked"
                      Grid.Row="1" Grid.ColumnSpan="2" />
            </Grid>
          </Frame>
        </AbsoluteLayout>
    </ScrollView>
</pages:PopupPage>

C#:

using AppBDE.pro.Repositories;
using AppBDE.pro.ViewModels;
using Rg.Plugins.Popup.Extensions;
using Rg.Plugins.Popup.Pages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace AppBDE.pro.Pages
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class EmployeeIdPopupPage : PopupPage
    {
        public EmployeeIdViewModel Vm { get; set; }

        public EmployeeIdPopupPage(EmployeeIdViewModel vm) : this()
        {
            BindingContext = Vm = vm;
        }

        public EmployeeIdPopupPage()
        {
            if (Vm == null)
            {
                BindingContext = Vm = new EmployeeIdViewModel();
            }

            InitializeComponent();
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            //if the employeID is set and it should be set then set the employeeId in the entry
            //if not then set the focus on the entry
            if (SettingsRepository.Current.ShouldEmployeeIdSaved && SettingsRepository.Current.EmployeeId != -1)
            {
                Vm.EmployeeId = SettingsRepository.Current.EmployeeId + "";
            }
            else
            {
                _idEntry.Focus();
            }
        }


        public async void OnIdConfirmClicked(object sender, EventArgs e)
        {
            SendPostTimeToVM();
            await Navigation.PopPopupAsync();
        }

        private void SendPostTimeToVM()
        {
            Vm.PostTimeAsync();
            Vm.EmployeeId = "";
        }
    }
}

and the call:

if (page is PopupPage p)
                {
                    await Navigation.PushPopupAsync(p);
                }

@kayjoekahmann I can only say one thing. If you get this exception then you use one instance of PopupPage few times. Check your code.

@Maxima078 @rotorgames
My apologies...
Regarding my previous comment about my iPad mini 4, the version of Rg.Plugins.Popup I'm using is still 1.04. I will try the latest patch and see if that changes anything.

Exactly the same issue. When do you plan to release the fix ?

@marcnegri What issue?

Hooo Sorry, I was speaking about this issue : The popup does not close when Background click on Android with Xamarin.Forms 2.4.0.280. This works with version 2.3.x.

@marcnegri What version of plugin do you use?

I'm using the 1.0.4 version. (btw, thank you very much for your work !!)

@marcnegri Thanks. You should update plugin to v1.1.0-pre3

I update plugin to v1.1.0-pre3, but still not working. I launch it on Debug et I notice that when I click outside the popup, OnBackgroundClicked is not called

@marcnegri Show your xaml code of popup page.

I just tested and it looks fine for me. thank you

v1.1.0-pre3 restores the tap on background closes popup functionality in my app after update to XF 2.4.0.18342 thank you @rotorgames !

BTW for others I had to "aggressively" clean my solution to ensure I was using pre3 (manually delete project bin and obj directories).

Forgot to mention, I used latest pre release 2.5 version and it works for it also.

1.1.0-pre3 Works for me now too.
I upgraded XF to 2.4.0.18342 from 2.3.5-pre6

It also works for me with last pre-release 1.1.0-pre3 and Xamarin.Forms
2.4.0.282.

Many thanks !

2017-10-24 3:07 GMT+02:00 gcadmes notifications@github.com:

1.1.0-pre3 Works for me now too.
I upgraded XF to 2.4.0.18342 from 2.3.5-pre6

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rotorgames/Rg.Plugins.Popup/issues/173#issuecomment-338840599,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH-ezUF9IijGRm-O8qxcaRJTr2Ly6mABks5svThKgaJpZM4PnCWS
.

Pre-release 1.1.0-pre3 fix the issue, tested with Xamarin.Forms 2.4.0.18342. Thank you.

Hi, I'll check it out. Obviously, it's my code.

I just noticed that with this new version, on Android popup is closed even
when we click inside the popup (tap to a label for instance). Is this
expected?

2017-10-24 10:27 GMT+02:00 Marc Negri notifications@github.com:

Hi, I'll check it out. Obviously, it's my code.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rotorgames/Rg.Plugins.Popup/issues/173#issuecomment-338913966,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH-ezX7G1vGi0kzZcUU-pvKqvSsaF-f0ks5svZ9VgaJpZM4PnCWS
.

@Maxima078 I have the same issue

@Maxima078 No It isn't. What versions of Android, XF, Popup do you use?

@Kirill last pre-release 1.1.0-pre3 and Xamarin.Forms 2.4.0.282.

2017-10-25 6:50 GMT+02:00 Kirill notifications@github.com:

@Maxima078 https://github.com/maxima078 No It isn't. What versions of
Android, XF, Popup do you use?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rotorgames/Rg.Plugins.Popup/issues/173#issuecomment-339213675,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH-ezVdDgQ8QdtfMHaZ2kaWTdmL9JVwHks5svr4ygaJpZM4PnCWS
.

Regarding the diff https://github.com/rotorgames/Rg.Plugins.Popup/commit/e76d28da8ada296b3f00d59057c851e96bbd2b4d#diff-cb6516f5f2be354418b567b671d18c9c it seems expected since you are using the OnTouchEvent() method directly from the page. Shouldn't you use a "background layout" with a gestureRecognizer to separate touch event from background and content of the page?

I tested using XF 2.5 pre version and when I tap inside popup where I have grid label etc, it doesnt close for me. only if I click transparent are which is considered background causes to pop out

@EmilAlipiev did you try both Android and iOS? This happens only in Android. Are you sure your content is not catching events (such as radiobutton or button entry etc.)? I'll try with XF 2.5 but it is not a solution since still in beta.

Hi everyone,

I had to clean my solution. And after that, it works fine ! Thanks
pre-release 1.1.0-pre3 and Xamarin.Forms
2.4.0.282.

@marcnegri Isn't your popup closing when you click inside the popup content?

@Maxima078, no i saw your issue and I tried to click every in the pop-up ( my pop-up has 2 labels) and I don't have your issue. Everything seems fine.

Do you have a complex xaml ?

It couldn't be simpler :

<?xml version="1.0" encoding="utf-8" ?>
<pages:PopupPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
    xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
    x:Class="Sample.ItemsPopup"
    BackgroundColor="Transparent"
    x:Name="Ppage">
    <pages:PopupPage.Animation>
        <animations:MoveAnimation
            PositionIn="Top"
            PositionOut="Top"
            EasingIn="SinOut"
            EasingOut="SinIn" />
    </pages:PopupPage.Animation>
     <StackLayout
        BackgroundColor="Green"
        VerticalOptions="Center"
        HorizontalOptions="Center"
        WidthRequest="200"
        HeightRequest="200">
        <Label
            Text=" foooooooooooo" />
        <Label
            Text=" baaaaaaaaaaar" />
        <Label
            Text=" foooooooooooo" />
        <Label
            Text=" baaaaaaaaaaar" />
    </StackLayout>
</pages:PopupPage>

Nothing in my .xaml.cs except InitializeComponent().

@Maxima078 What version of Android?

@Kirill last pre-release 1.1.0-pre3 and Xamarin.Forms 2.4.0.282.

Android 7.1.1 with my OnePlus 3
Android 6.0.1 with Sony Xperia compact Z3

@Maxima078 @YZahringer Confirmed

@Maxima078 @YZahringer I think that it is problem of Xamarin.Forms. XF doesn't invoke Click method from PageRenderer and always invokes OnTouchEvent even if a touch has tapped on children.

Hi @rotorgames, I am facing a similar issue (may be the same). I recently update Xamarin and Xamarin forms in our project to latest versions and in doing so I can no longer close popups when the background is clicked. we have verified that the property is set to true, and we have upgraded to 1.1.0-pre3 (we were on pre1 previously).

I have read about cleaning the solution and have gone through deleted bin/obj folders, cleaned the solution, open and closed visual studio to make sure files were in fact unlocked and removed. When i use this function:

private void ShowPopup(PopupPage popup)
        {
            Device.BeginInvokeOnMainThread(() =>
            {
                try
                {
                    var test = new TestPopup();
                    var instance = PopupNavigation.Instance;
                    if (instance != null)
                    {
                        if (test != null)
                        {
                            instance.PushAsync(test);
                        }
                        //PopupNavigation.Instance.PushAsync(popup);
                    }
                }
                catch (Exception ex)
                {
                    this.logger.Error("Error Showing Popup", ex);
                }
            });
        }

I get a null reference error from PushAsync even though our popup nor the instance is not null. something inside push async comes back as null and I can not troubleshoot anything further on my end.

the xaml we are using:

<?xml version="1.0" encoding="utf-8" ?>

<pages:PopupPage x:Class="PathfinderX.Display.Popups.TestPopup"
                 xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
                 xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
                 x:Name="this"
                 BindingContext="{x:Reference this}"
                 CloseWhenBackgroundIsClicked="True">

    <!--  Animation  -->
    <pages:PopupPage.Animation>
        <animations:ScaleAnimation DurationIn="0"
                                   DurationOut="0"
                                   EasingIn="SinOut"
                                   EasingOut="SinIn"
                                   HasBackgroundAnimation="True"
                                   PositionIn="Center"
                                   PositionOut="Center"
                                   ScaleIn="1"
                                   ScaleOut="1" />
    </pages:PopupPage.Animation>

    <!--  Content  -->

    <Grid BackgroundColor="Gray">

        <Grid.RowDefinitions>
            <RowDefinition Height="2*" />
            <RowDefinition Height="6*" />
            <RowDefinition Height="2*" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="6*" />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>

        <Grid x:Name="ContentGrid"
              Grid.Row="1"
              Grid.Column="1"
              Padding="10"
              HorizontalOptions="Fill"
              BackgroundColor="Black"
              VerticalOptions="Fill">

            <Grid.RowDefinitions>
                <RowDefinition Height="10" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="10" />
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
            </Grid.ColumnDefinitions>

            <Label Grid.Row="2"
                   Grid.Column="3"
                   HorizontalOptions="StartAndExpand"
                   Text="I'm a Popup!"/>
        </Grid>
    </Grid>

</pages:PopupPage>

The code behind for the xaml is:

using Xamarin.Forms.Xaml;

namespace Project1.Display.Popups
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class TestPopup
    {
        public TestPopup()
        {
            InitializeComponent();
        }
        protected override bool OnBackButtonPressed()
        {
            return true;
        }
    }
}

CloseWhenBackgroundIsClicked="True" in the XAML work for me, but I have 3 Entry and popup dismiss if I click between 2 entry. It should work only when Transparent background is tapped

<pages:PopupPage.Animation>
        <animations:ScaleAnimation 
      PositionIn="Center"
      PositionOut="Center"
      ScaleIn="1.2"
      ScaleOut="0.8"
      DurationIn="400"
      DurationOut="300"
      EasingIn="SinOut"
      EasingOut="SinIn"
      HasBackgroundAnimation="True"/>
    </pages:PopupPage.Animation>
    <StackLayout BackgroundColor="White"  WidthRequest="100" Padding="16"  HeightRequest="200">
        <Label Text="Filtro " HorizontalTextAlignment="Center" FontSize="25"/>
        <Entry Placeholder=" partenza" HorizontalTextAlignment="Center" Margin="8"/>
            <Entry Placeholder=" destinazione" HorizontalTextAlignment="Center" Margin="8"/>
            <Entry Placeholder=" partenza" HorizontalTextAlignment="Center" Margin="8"/>
        <Button Text="Ricerca"/>
    </StackLayout>

@mhawman Hi. PushAsync is an async method. You should invoke it with await operator. await instance.PushAsync(test);

@psummo v1.1.0-pre3 has some problem with CloseWhenBackgroundIsClicked. It happens because of Xamarin.Forms 2.4.x

<StackLayout x:Name="PopupWindow" VerticalOptions="FillAndExpand" Orientation="Vertical" HorizontalOptions="FillAndExpand"  BackgroundColor="Transparent"  Padding="20, 0, 20, 20">
    <StackLayout WidthRequest="500" VerticalOptions="CenterAndExpand" Orientation="Vertical" HorizontalOptions="CenterAndExpand" HeightRequest="120" Padding="15, 15, 15, 15" BackgroundColor="Transparent">
        <Image x:Name="Butterfly" Aspect="AspectFit" HeightRequest="40" WidthRequest="40" Source="butterfly.png" BackgroundColor="Transparent" />
        <Label x:Name="AffilationMessage" FontSize="22" TextColor="White" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"></Label>
    </StackLayout>
</StackLayout>

var WindowTap = new TapGestureRecognizer();
WindowTap.Tapped += (s, e) =>
{
Navigation.PopPopupAsync();
};
PopupWindow.GestureRecognizers.Add(WindowTap);

  • Make your popup fullscreen and transparent, then create a middle container, then add a tapgesture to PopupWindow

-pre3 doesn't seem to fix the bug. Is there anything else we need to be doing?

  <package id="Rg.Plugins.Popup" version="1.1.0-pre3" targetFramework="portable45-net45+win8" />
  <package id="Xamarin.Forms" version="2.4.0.38779" targetFramework="portable45-net45+win8" />

EDIT: I should clarify.
I did a clean/rebuild and deleted obj/ and bin/ folders. I can now dismiss the popup as expected BUT, I get the IllegalStateException now.

11-10 08:31:50.170 I/MonoDroid(27348): UNHANDLED EXCEPTION:
11-10 08:31:50.246 I/MonoDroid(27348): Java.Lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in :0
11-10 08:31:50.246 I/MonoDroid(27348): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in :0
11-10 08:31:50.246 I/MonoDroid(27348): at Android.Views.ViewGroup.AddView (Android.Views.View child) [0x00031] in <2e14bb2dd93a405e81838369ed72695b>:0
11-10 08:31:50.246 I/MonoDroid(27348): at Rg.Plugins.Popup.Droid.Impl.PopupPlatformDroid+d__4.MoveNext () [0x0003e] in :0
11-10 08:31:50.246 I/MonoDroid(27348): --- End of stack trace from previous location where exception was thrown ---
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at Rg.Plugins.Popup.Services.PopupNavigationImpl+d__9.MoveNext () [0x0007e] in <15245daa4e2e472ead1e56ee10d1b717>:0
11-10 08:31:50.246 I/MonoDroid(27348): --- End of stack trace from previous location where exception was thrown ---
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.246 I/MonoDroid(27348): at Rg.Plugins.Popup.Services.PopupNavigationImpl+d__5.MoveNext () [0x00094] in <15245daa4e2e472ead1e56ee10d1b717>:0
11-10 08:31:50.246 I/MonoDroid(27348): --- End of stack trace from previous location where exception was thrown ---
11-10 08:31:50.246 I/MonoDroid(27348): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.247 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.247 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.247 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.247 I/MonoDroid(27348): at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.247 I/MonoDroid(27348): at MyApp.SelfServe.Mobile.Pages.Projects.ProjectDetailsPage+d__18.MoveNext () [0x0002e] in C:\Dev\SelfServe\src\mobile\MyApp.SelfServe.Mobile\Pages\Projects\ProjectDetailsPage.xaml.cs:60
11-10 08:31:50.247 I/MonoDroid(27348): --- End of stack trace from previous location where exception was thrown ---
11-10 08:31:50.247 I/MonoDroid(27348): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.247 I/MonoDroid(27348): at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0 (System.Object state) [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
11-10 08:31:50.247 I/MonoDroid(27348): at Android.App.SyncContext+<>c__DisplayClass2_0.b__0 () [0x00000] in <2e14bb2dd93a405e81838369ed72695b>:0
11-10 08:31:50.247 I/MonoDroid(27348): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <2e14bb2dd93a405e81838369ed72695b>:0
11-10 08:31:50.247 I/MonoDroid(27348): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <2e14bb2dd93a405e81838369ed72695b>:0
11-10 08:31:50.247 I/MonoDroid(27348): at (wrapper dynamic-method) System.Object:9d5a716e-2a59-4ead-9b6b-b3ac3b723226 (intptr,intptr)
11-10 08:31:50.247 I/MonoDroid(27348): --- End of managed Java.Lang.IllegalStateException stack trace ---
11-10 08:31:50.247 I/MonoDroid(27348): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.addViewInner(ViewGroup.java:4915)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.addView(ViewGroup.java:4746)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.addView(ViewGroup.java:4686)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.addView(ViewGroup.java:4659)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.InnerGestureListener.n_onSingleTapUp(Native Method)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.GestureDetector.onTouchEvent(GestureDetector.java:640)
11-10 08:31:50.247 I/MonoDroid(27348): at md57018357d52b54713cd814fbd5262dd1f.LabelRenderer.n_onTouchEvent(Native Method)
11-10 08:31:50.247 I/MonoDroid(27348): at md57018357d52b54713cd814fbd5262dd1f.LabelRenderer.onTouchEvent(LabelRenderer.java:53)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.View.dispatchTouchEvent(View.java:11721)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.n_dispatchTouchEvent(Native Method)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.Platform_DefaultRenderer.dispatchTouchEvent(Platform_DefaultRenderer.java:54)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.n_dispatchTouchEvent(Native Method)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.dispatchTouchEvent(VisualElementRenderer_1.java:64)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.n_dispatchTouchEvent(Native Method)
11-10 08:31:50.247 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.dispatchTouchEvent(VisualElementRenderer_1.java:64)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.247 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.248 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.n_dispatchTouchEvent(Native Method)
11-10 08:31:50.248 I/MonoDroid(27348): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.dispatchTouchEvent(PlatformRenderer.java:55)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
11-10 08:31:50.248 I/MonoDroid(27348): at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:445)
11-10 08:31:50.248 I/MonoDroid(27348): at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1828)
11-10 08:31:50.248 I/MonoDroid(27348): at android.app.Activity.dispatchTouchEvent(Activity.java:3292)
11-10 08:31:50.248 I/MonoDroid(27348): at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
11-10 08:31:50.248 I/MonoDroid(27348): at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
11-10 08:31:50.248 I/MonoDroid(27348): at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:407)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.View.dispatchPointerEvent(View.java:11960)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4776)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4590)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4274)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4331)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6642)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6616)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6577)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6745)
11-10 08:31:50.248 I/MonoDroid(27348): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
11-10 08:31:50.248 I/MonoDroid(27348): at android.os.MessageQueue.nativePollOnce(Native Method)
11-10 08:31:50.248 I/MonoDroid(27348): at android.os.MessageQueue.next(MessageQueue.java:325)
11-10 08:31:50.248 I/MonoDroid(27348): at android.os.Looper.loop(Looper.java:142)
11-10 08:31:50.248 I/MonoDroid(27348): at android.app.ActivityThread.main(ActivityThread.java:6541)
11-10 08:31:50.248 I/MonoDroid(27348): at java.lang.reflect.Method.invoke(Native Method)
11-10 08:31:50.248 I/MonoDroid(27348): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
11-10 08:31:50.248 I/MonoDroid(27348): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
11-10 08:31:50.248 I/MonoDroid(27348):

@ChaseFlorell You should do RemovePage before using an instance of PopupPage again.

@rotorgames I'm not getting this error anymore, my solution is what I described in #185

I had the same problem, but cleaning the project was solved.
My versions are:
pre-release 1.1.0-pre3
Xamarin Forms 2.5.0.77107

@Maxima078 @YZahringer I have fixed your problem. BackgroundClicked will be invoked only if an user will click on a background.

Please test it and notify me about results. Thanks.

Hi this issue is still happening in my project. I am not able to close popup on background click.. I dont think xamarin version is a problem here since I tried this plugin with simple xamarin project and it was working fine. Is this plugin dependent on any third party libraries as well? We are using some third party libraries in our project like Xlabs.

@ChaseFlorell Thanks friend. It worked showing and closing the Popup Page respectively, writing:

1. PopupNavigation.PushAsync(_popupPage_)
2. PopupNavigation.PopAsync()

It's working in my current project I am currently using XF 2.4.0.18342 and PopUp 1.1.0-pre3.
Here is what i did:

  1. When declaring my PopupPage in XAML I set CloseWhenBackgroundIsClicked="False"
  2. Overrode OnBackgroundClicked like this:
    c# protected override bool OnBackgroundClicked() { PopupNavigation.Instance.PopAsync(); return true; }

However I still have a problem with this. If I tap a non input element the popup will dismiss as if I have tapped the background. I tested it on Android(real device) and iOS (simulator) and this problem only occurs on Android.
I expect this to solve your problem (as a workaround for now).

@rotorgames Yes it's fixed, thanks!

i have an issue with the popup when we click on the pace button.popup opens multiple times.can you please check

@SantoshHappiestMinds If an user click on a button several times that a popup will be opened several times.

can we stop that by not opening many times ?

You do that in your own code on the CanExecute command or similar.

Or check before if any open popup in the stack

Same Problem on Android.
Background Click doesn't work for poping back.

Same Problem on Android.
OnBackgroundClicked does not work.
XF 2.4.0.282
Plugins.Popup 1.0.4

Can someone tell me which version of RG works with which version of Xamarin, please?
await PopupNavigation.Instance.PopAsync (); it doesn't close the popup, OnBackgroundClicked does not work either

When pushing the popup, set the animation argument to ‘false’. This (I think) fixes the issue with RG 1.0.4. We fixed this a long time ago in our app, then upgraded to the latest pre-release.

I’m using the latest XF and RG and I’m not seeing any issues when background is clicked.

Cool... it's fixed, thanks!

Just use the last pre/beta release.

Was this page helpful?
0 / 5 - 0 ratings