Anton
Anton

Reputation: 23

Xamarin forms Picker control issue (android, appcompat)

Steps to reproduce issue:

  1. Create blank XF app, apply app compat and material design following this guide
  2. Add Picker control to main page with some items (doesnt matter what)
  3. Start app (tested on device 5.0 and emulator 4.4), try to fast double tap on pickers EditText field - it causes opening of two AlertDialog (or whatever) with pickers elements to select. When you choose some element or touches cancel button top dialog dismisses and shows underlying (we tapped twice and if we was fast enough - got two dialogs). Selecting any item or cancel button on second dialog we getting NullReferenceException (sender - AlertDialog, "this" Xamarin.Forms.Platform.Android.AppCompat.PickerRenderer), stack trace here:

at Xamarin.Forms.Platform.Android.AppCompat.PickerRenderer.b__9_2 (System.Object sender, System.EventArgs args) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\PickerRenderer.cs:110 at Android.Content.IDialogInterfaceOnDismissListenerImplementor.OnDismiss (IDialogInterface dialog) [0x0000d] in /Users/builder/data/lanes/3415/7db2aac3/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/3415/7db2aac3/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Content.IDialogInterface.cs:334 at (wrapper dynamic-method) System.Object:b6f021d2-c6e1-4672-9b03-e892d275f304 (intptr,intptr,intptr)

Without appcompat I cant reproduce it, at least I cant get two dialogs show. Seems like by selecting value on second dialog, we are trying to access somethig from dismissed one and getting exception. Any suggestion how to work around with that?

Upvotes: 2

Views: 1006

Answers (1)

Paul
Paul

Reputation: 1175

We just merged in a fix for this and the changes should be available beginning with the 2.3.2 prereleases.

Upvotes: 1

Related Questions