Rg.Plugins.Popup: Doesn't show popup if application is paused and then resumed

Using the latest pre-released version: 1.1.3.73-pre

If I run my application on Android, then pressed back button -> application goes to paused mode after that I resume back and cannot show any popup windows anymore.

It simply never returned from await _navigation.PushPopupAsync(page); (The only difference from the examples I can see is that we use FormsAppCompatActivity, NOT FormsApplicationActivity, not sure if it can be a problem)

Then if I tap back button, nothing is happening. Tap it again (second time), get exception:

01-03 17:05:11.009 I/MonoDroid(11178): System.InvalidOperationException: Sequence contains no elements
01-03 17:05:11.009 I/MonoDroid(11178):   at System.Linq.Enumerable.Last[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <65f4a23934a3468fae9abe3139b55169>:0 
01-03 17:05:11.009 I/MonoDroid(11178):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.HandleBackPressed (System.Object sender, System.EventArgs e) [0x0000a] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:281 
01-03 17:05:11.009 I/MonoDroid(11178):   at (wrapper delegate-invoke) <Module>:invoke_bool_object_EventArgs (object,System.EventArgs)
01-03 17:05:11.009 I/MonoDroid(11178):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnBackPressed () [0x00000] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:63 
01-03 17:05:11.009 I/MonoDroid(11178):   at Android.App.Activity.n_OnBackPressed (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <c8cab2efd85f442389020057942eca89>:0 
01-03 17:05:11.009 I/MonoDroid(11178):   at (wrapper dynamic-method) System.Object:fe9499a8-27c1-4801-821e-2260ccec42ec (intptr,intptr)
01-03 17:05:11.018 I/System.out(11178): (HTTPLog)-Static: isSBSettingEnabled false

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

@swapnil591 I think that it must work. You should be able to open a new page after an application resuming. I will review it and will fix it soon

@swapnil591 @wattsdeveloper I have changed some code recently so you can have some problem with it. I have added code which remove each popup pages from PopupStack when the Init method is invoked. I had to do it because Xamarin.Android doesn’t remove static fields from memory when an application is sleeping because of it the PopupStack is not cleaned and you can see old pages which there are not in the display but there are in the PopupStack after an application has been resumed.