Bug 48147 - If I try PushModalPage while a prompt is still opened, app crashes. (Forms' Android)
Summary: If I try PushModalPage while a prompt is still opened, app crashes. (Forms' A...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.3
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-28 05:16 UTC by Bright Lee
Modified: 2017-06-19 19:25 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
stacktrace (161.92 KB, image/png)
2016-11-28 05:16 UTC, Bright Lee
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Bright Lee 2016-11-28 05:16:56 UTC
Created attachment 18684 [details]
stacktrace

If I try PushModalPage while a prompt is still opened, app crashes. (Forms' Android)
Prompt that I mentioned is like a permission alert window on Android.

My modal page needed to be pushed automatically in some case like a announcement.

But
"Java.Lang.RuntimeException: Can not perform this action after onSaveInstanceState"


tested on Android 6.0
Xamarin forms 2.3.3



Java.Lang.RuntimeException: Can not perform this action after onSaveInstanceState
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <2af388b7a2e94afe89596a2181bd5056>:0
  at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <2c7dc34cd8314860bd3e55b10e55d264>:0
  at Android.Support.V4.App.FragmentTransactionInvoker.Commit () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.SwitchContentAsync (Xamarin.Forms.Page view, System.Boolean animated, System.Boolean removed, System.Boolean popToRoot) [0x0014b] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:621
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPushAsync (Xamarin.Forms.Page view, System.Boolean animated) [0x00000] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:452
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.PushViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00000] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:108
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x0018e] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:252
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000f4] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:193
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:129
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Platform.cs:289
  at Xamarin.Forms.Platform.Android.AppCompat.Platform+ModalContainer..ctor (Android.Content.Context context, Xamarin.Forms.Page modal) [0x00038] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:335
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.PresentModal (Xamarin.Forms.Page modal, System.Boolean animated) [0x0000d] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:285
  at Xamarin.Forms.Platform.Android.AppCompat.Platform+<Xamarin-Forms-INavigation-PushModalAsync>d__30.MoveNext () [0x0004a] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:150
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at Xamarin.Forms.Application+NavigationImpl+<OnPushModal>d__3.MoveNext () [0x0008d] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\Application.cs:330
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at allbX.AnnouncePage+<CheckNewAnnounce>c__async0.MoveNext () [0x002df] in /Users/bright/Devlibs/project/allb_xamarin/allbX/allbX/Pages_NotiTab/AnnouncePage.xaml.cs:118
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__1 (System.Object state) [0x00000] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000e] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <5ba073af17cd4220bb60f6d1acb0950e>:0
  at java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
  at at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1493)
  at at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1511)
  at at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
  at at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:617)
Comment 1 adrianknight89 2016-11-28 05:55:06 UTC
Possible fix: https://github.com/xamarin/Xamarin.Forms/pull/527
Comment 2 Bright Lee 2016-11-28 08:28:02 UTC
Oh Thanks, So it will be with an XF update in a future, right?

I saw that but didn't know it's merged.

Thanks.
Comment 3 adrianknight89 2016-11-28 15:27:54 UTC
I'm not sure if it was included in 2.3.4-pre1, but you should see it at least before stable.
Comment 4 Bright Lee 2016-11-28 18:35:51 UTC
OK Thanks!
Comment 5 Samantha Houts [MSFT] 2016-11-29 20:01:38 UTC
The PR mentioned was indeed included in 2.3.4-pre1. Please let us know if it resolved the issue.

Thanks!
Comment 6 Samantha Houts [MSFT] 2017-06-19 18:53:24 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!
Comment 7 Bright Lee 2017-06-19 19:25:25 UTC
Thanks. It's working fine now.