Bug 50540 - PullToRefresh causes crash when context action option is open
Summary: PullToRefresh causes crash when context action option is open
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 2.3.1
Hardware: All Mac OS
: --- major
Target Milestone: ---
Assignee: Chris King
URL:
Depends on:
Blocks:
 
Reported: 2016-12-20 22:33 UTC by Rob Hedgpeth
Modified: 2017-07-12 08:04 UTC (History)
8 users (show)

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


Attachments
SampleApp (49.78 KB, application/zip)
2016-12-20 22:33 UTC, Rob Hedgpeth
Details
Attached are the generated when issue is reproduced(Reopen) (5.81 KB, application/zip)
2017-07-05 07:23 UTC, Saurabh Paunikar
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:
VERIFIED FIXED

Description Rob Hedgpeth 2016-12-20 22:33:41 UTC
Created attachment 18948 [details]
SampleApp

I have attached a small sample app to reproduce the issue.

Steps to reproduce:

1.) Long-press to display context action menu
2.) Pull-to-refresh on listview 

Error in output:

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.NullReferenceException: Object reference not set to an instance of an object.
[MonoDroid]   at Xamarin.Forms.Platform.Android.CellAdapter.set_ContextView (Android.Views.View value) [0x00012] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\CellAdapter.cs:67 
[MonoDroid]   at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (System.Int32 position, Android.Views.View convertView, Android.Views.ViewGroup parent) [0x000e8] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:214 
[MonoDroid]   at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 position, System.IntPtr native_convertView, System.IntPtr native_parent) [0x0001a] in /Users/builder/data/lanes/3511/ce955cc0/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Android.Widget.BaseAdapter.cs:443 
[MonoDroid]   at (wrapper dynamic-method) System.Object:bc522232-2074-4bf5-b683-31f771df66d1 (intptr,intptr,int,intptr,intptr)
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_throw'.
[Mono] Probing 'java_interop_jnienv_throw'.
[Mono] Found as 'java_interop_jnienv_throw'.
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.NullReferenceException: Object reference not set to an instance of an object.
[MonoDroid]   at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*)
[MonoDroid]   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008f] in /Users/builder/data/lanes/3511/ce955cc0/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079 
[MonoDroid]   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00022] in /Users/builder/data/lanes/3511/ce955cc0/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:41 
[MonoDroid]   at Android.Views.ViewGroup.Layout (System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00055] in /Users/builder/data/lanes/3511/ce955cc0/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Android.Views.ViewGroup.cs:3188 
[MonoDroid]   at Xamarin.Forms.Platform.Android.ViewRenderer`2[TView,TNativeView].OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00059] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\ViewRenderer.cs:132 
[MonoDroid]   at Xamarin.Forms.Platform.Android.ListViewRenderer.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00000] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\ListViewRenderer.cs:168 
[MonoDroid]   at Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean p0, System.Int32 p1, System.Int32 p2, System.Int32 p3, System.Int32 p4) [0x00008] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240 
[MonoDroid]   at (wrapper dynamic-method) System.Object:0f920876-7042-42d5-84e6-56e2980937e9 (intptr,intptr,bool,int,int,int,int)
Comment 1 Rob Hedgpeth 2016-12-20 22:34:26 UTC
I can confirm this is also happening in 2.3.2.127.
Comment 2 adrianknight89 2016-12-20 23:47:45 UTC
I have a PR fixing an NRE with context actions on Android: https://github.com/xamarin/Xamarin.Forms/pull/609

It might fix this as well (not verified).
Comment 3 Chris King 2017-05-04 17:20:24 UTC
No longer reproduces on latest master.
Comment 4 Saurabh Paunikar 2017-07-05 07:23:38 UTC
Created attachment 23293 [details]
Attached are the generated when issue is reproduced(Reopen)
Comment 5 Saurabh Paunikar 2017-07-05 08:05:09 UTC
on Xamarin.Form version 2.3.5.256-pre6 able to reproduce this issue 

ScreenCast link: https://www.screencast.com/t/7cGw4wMZkhJ
Comment 7 Saurabh Paunikar 2017-07-12 08:04:41 UTC
Verified on xamarin.form version 2.3.5.256-pre6

ScreenCast link : https://screencast.com/t/AQbZuuWdX