Bug 43965 - app crashes if picker is clicked really quickly
Summary: app crashes if picker is clicked really quickly
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.1
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Paul DiPietro [MSFT]
Depends on:
Reported: 2016-09-02 08:04 UTC by Silvio
Modified: 2017-06-19 22:32 UTC (History)
11 users (show)

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

Image (49.77 KB, image/png)
2017-04-24 17:23 UTC, Momm
Project (50.13 KB, application/zip)
2017-04-24 17:23 UTC, Momm

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:

Description Silvio 2016-09-02 08:04:57 UTC
I was able to reproduce this with multiple devices and the simulator.
Comment 1 Silvio 2016-09-02 10:25:10 UTC

System.NullReferenceException: Object reference not set to an instance of an object.
  at Xamarin.Forms.Platform.Android.AppCompat.PickerRenderer.<OnClick>b__9_2 (System.Object sender, System.EventArgs args) [0x00000] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\PickerRenderer.cs:110
  at Android.Content.IDialogInterfaceOnDismissListenerImplementor.OnDismiss (IDialogInterface dialog) [0x0000d] in /Users/builder/data/lanes/3540/1cf254db/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Content.IDialogInterface.cs:369
  at Android.Content.IDialogInterfaceOnDismissListenerInvoker.n_OnDismiss_Landroid_content_DialogInterface_ (IntPtr jnienv, IntPtr native__this, IntPtr native_dialog) [0x00011] in /Users/builder/data/lanes/3540/1cf254db/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Content.IDialogInterface.cs:334
  at at (wrapper dynamic-method) System.Object:bf8be781-1e0b-4597-8aa4-0c6bfbebedf6 (intptr,intptr,intptr)
Comment 2 Paul DiPietro [MSFT] 2016-09-02 17:10:33 UTC
Can you attach a reproduction? Are you talking about clicking off of the picker, on the cancel button, or something else? I believe this should have been recently addressed.
Comment 3 Silvio 2016-09-05 05:55:23 UTC
clicking off of the picker. I don't know about it having been addressed. I'm using Forms
Comment 4 Tibo 2016-10-31 16:40:31 UTC
Same problem here with Xamarin Forms on Android and iOS.

Is there a fix planned for this bug?

Easy to reproduce with a big list (list of countries for example):
- Open picker
- Scroll down 
- Tap on "done" before scrolling has ended
Comment 5 Richard Rachowski 2016-11-21 00:07:43 UTC
Any progress on this? I'm getting the same issue on Android with Forms version
Comment 6 Momm 2016-11-29 20:53:56 UTC
I was able to reproduce it as well.

I'm in a page where we have a Picker, I click on it really quickly and then I return to the former page (I have a page with some pickers and a OK button, like a filtering page). App goes to the former page and shows the Picker dialog, after pressing OK/CANCEL on it, app crashes.

See crash log:
  at Xamarin.Forms.Platform.Android.PickerRenderer.<OnClick>b__10_0 (System.Object s, Android.Content.DialogClickEventArgs a) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\PickerRenderer.cs:113 
  at Android.Content.IDialogInterfaceOnClickListenerImplementor.OnClick (Android.Content.IDialogInterface dialog, System.Int32 which) [0x0000d] in /Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Content.IDialogInterface.cs:250 
  at Android.Content.IDialogInterfaceOnClickListenerInvoker.n_OnClick_Landroid_content_DialogInterface_I (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_dialog, System.Int32 which) [0x00011] in /Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Content.IDialogInterface.cs:201 
  at (wrapper dynamic-method) System.Object:ae0990ee-3ce1-4013-bbc5-d280fc6ebd0e (intptr,intptr,intptr,int)
Comment 7 rfreschi 2017-03-30 23:57:25 UTC
Seeing the same issue attempting to load some content based on the picker selection.


Android Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
  at Xamarin.Forms.Platform.Android.PickerRenderer.<OnClick>b__11_2 (System.Object sender, System.EventArgs args) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\PickerRenderer.cs:145 
  at Android.Content.IDialogInterfaceOnDismissListenerImplementor.OnDismiss (Android.Content.IDialogInterface dialog) [0x0000d] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Content.IDialogInterface.cs:369 
  at Android.Content.IDialogInterfaceOnDismissListenerInvoker.n_OnDismiss_Landroid_content_DialogInterface_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_dialog) [0x00011] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Content.IDialogInterface.cs:334 
  at (wrapper dynamic-method) System.Object:7f80ad2f-4c9d-4cac-8b89-acf123a76958 (intptr,intptr,intptr)
Comment 8 Samantha Houts [MSFT] 2017-04-17 18:24:48 UTC
rfreschi@hpsj.com: Are you able to provide a small reproduction project exhibiting the issue? Thank you!
Comment 9 Momm 2017-04-24 17:22:42 UTC
Hi Samantha,

I was able to reproduce it on, but in the latest version ( it seems to be working fine.

Check this reproduction project. 

Steps:You just need to tap the button in the first screen, then, in the 2nd one, tap the picker and back arrow really fast, so it will go back to the former screen, but the modal will be still opened. Close the modal and then you will see the crash on

The weird part is, if I upgrade XF package (and Support, etc) in my real project, the error still happens, so not sure what's impacting it.

Comment 10 Momm 2017-04-24 17:23:02 UTC
Created attachment 21736 [details]
Comment 11 Momm 2017-04-24 17:23:20 UTC
Created attachment 21737 [details]
Comment 12 aed 2017-06-02 18:25:56 UTC
any updates on this bug? it happens quite frequently and there's a few repro cases above.
Comment 13 Rui Marinho 2017-06-19 22:32:02 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms 2.3.4 stable. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.

Here are some reproduction best practices: https://gist.github.com/jassmith/92405c300e54a01dcc6d