AlertDialog freezes when Android 6.0 resumes from screen blank

TonyCeliaTonyCelia ✭✭USMember ✭✭

I'm building an Android App with Visual Studio 2015/Xamarin. My app is compiled with API 23 Target and Minimum API of 22. In my Activity (which extends AppCompatActivity), I have an AlertDialog that works flawlessly on Android 5.1, but freezes on Android 6.0 if the phone resumes from a screen blank while the AlertDialog is displayed (AlertDialog is displayed before screen goes blank, screen goes blank, phone resumes and AlertDialog is frozen). The AlertDialog is dismissed if the phone screen is rotated.

Has anyone seen this and if so, how did you resolve this problem?


  • TonyCeliaTonyCelia ✭✭ USMember ✭✭

    Note that AlertDialog freezes as stated above with Android.App.AlertDialog.Builder and Android.Support.V7.App.AlertDialog.Builder.

  • TonyCeliaTonyCelia ✭✭ USMember ✭✭

    I have isolated the 'problem' to something that I'm doing. I am overriding OnRestart() to include Recreate() for various reasons. I reviewed the Activity lifecycle and now understand how this could interfere with an open AlertDialog when resuming from a screenblank, but I don't understand why the behavior would be different in Android 5.1 (where my AlertDialog works fine) and Android 6.0 (where my AlertDialog freezes). If anyone has thoughts, I'd appreciate the help. Thank you.

Sign In or Register to comment.