Bug 41717 - Picker allows multiple dialogs to be open causing the app to crash
Summary: Picker allows multiple dialogs to be open causing the app to crash
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 2.2.0
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Bugzilla
URL:
: 42148 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-10 18:14 UTC by c.krempp91
Modified: 2017-10-03 13:40 UTC (History)
7 users (show)

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


Attachments
Reproduction project (273.48 KB, application/x-zip-compressed)
2016-06-10 18:14 UTC, c.krempp91
Details

Description c.krempp91 2016-06-10 18:14:37 UTC
Created attachment 16283 [details]
Reproduction project

I have found an issue where if you have a picker within an Android app, that has AppCompact enabled. Then you tap the picker very rapidly multiple times, as if you were to select an item, multiple dialog windows appear. You can select "Cancel" on every single one, and most of the time the app will remain fine. 

The real problem is that if you select an item within the dialog, when multiple windows are present, then the app will crash and throw either a NullReferenceException or a IndexOutOfBoundsException.

I looked into the render to see if there was a problem, and I found that the PickerListener.OnClick function [Line 145] just calls the PickerRenderer.OnClick function [Line 95] which does not preform any check to see if a _dialog window is present. Here is the link to the file that I was looking at: https://github.com/xamarin/Xamarin.Forms/blob/2d9288eee6e6f197364a64308183725e7bd561f9/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs

I have attached a reproduction app that illustrates the problem, the version of Xamarin.Forms in the app is 2.0.0.6482, but the problem does happen in the latest version as well.
Comment 1 Samantha Houts [MSFT] 2016-06-24 17:16:40 UTC
*** Bug 42148 has been marked as a duplicate of this bug. ***
Comment 2 Toni L. 2016-07-14 10:36:40 UTC
Same problem here. Please fix asap.
Comment 3 Paul DiPietro [MSFT] 2016-07-18 23:29:21 UTC
Should be fixed for 2.3.2-pre.
Comment 4 Parmendra Kumar 2016-08-08 15:04:30 UTC
I have checked this issue with Xamarin.Forms 2.3.2-pre1 and this issue not appear with latest pre version.

Hence close this issue.

If you still facing same issue, Please feel free to reopen this issue or filed new bug for the same.

Thanks.

Note You need to log in before you can comment on or make changes to this bug.