Bug 36939 - Xamarin.Forms.Platform.Android.CellAdapter.HandleContextMode Null Exception on long tap on a Frame
Summary: Xamarin.Forms.Platform.Android.CellAdapter.HandleContextMode Null Exception o...
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-12-12 15:32 UTC by Ahmed Hassan
Modified: 2017-06-17 01:52 UTC (History)
5 users (show)

Tags: android, frame, listview
Is this bug a regression?: ---
Last known good build:

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:
RESOLVED NORESPONSE

Description Ahmed Hassan 2015-12-12 15:32:31 UTC
Setup:
Android 6.0
Using FormsAppCompatActivity
"Xamarin.Forms" version="2.0.1.6492-pre1"
"Xamarin.Android.Support.v7.AppCompat" version="23.0.1.3"

The frame is inside a ListView.Header if that makes any difference.

Doing a long tap on a Frame produces:

12-12 10:28:39.072: E/AndroidRuntime(2307): FATAL EXCEPTION: main
12-12 10:28:39.072: E/AndroidRuntime(2307): Process: com.SpaceMonkey.Boats, PID: 2307
12-12 10:28:39.072: E/AndroidRuntime(2307): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-12 10:28:39.072: E/AndroidRuntime(2307): Caused by: java.lang.reflect.InvocationTargetException
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at java.lang.reflect.Method.invoke(Native Method)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	... 1 more
12-12 10:28:39.072: E/AndroidRuntime(2307): Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
12-12 10:28:39.072: E/AndroidRuntime(2307):   at Xamarin.Forms.Platform.Android.CellAdapter.HandleContextMode (Android.Views.View view, Int32 position) <0xd8a228c8 + 0x001f7> in <filename unknown>:0 
12-12 10:28:39.072: E/AndroidRuntime(2307):   at Xamarin.Forms.Platform.Android.CellAdapter.OnItemLongClick (Android.Widget.AdapterView parent, Android.Views.View view, Int32 position, Int64 id) <0xd8a22730 + 0x0006b> in <filename unknown>:0 
12-12 10:28:39.072: E/AndroidRuntime(2307):   at Android.Widget.AdapterView+IOnItemLongClickListenerInvoker.n_OnItemLongClick_Landroid_widget_AdapterView_Landroid_view_View_IJ (IntPtr jnienv, IntPtr native__this, IntPtr native_parent, IntPtr native_view, Int32 position, Int64 id) <0xd8a22690 + 0x00091> in <filename unknown>:0 
12-12 10:28:39.072: E/AndroidRuntime(2307):   at (wrapper dynamic-method) System.Object:1814a5ea-c2d9-4005-ab59-1441f372deb6 (intptr,intptr,intptr,intptr,int,long)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.CellAdapter.n_onItemLongClick(Native Method)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.CellAdapter.onItemLongClick(CellAdapter.java:48)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.widget.AbsListView.showContextMenuForChild(AbsListView.java:3168)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:769)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:769)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:769)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:769)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.widget.AbsListView.performLongPress(AbsListView.java:3132)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:3059)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.os.Handler.handleCallback(Handler.java:739)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.os.Handler.dispatchMessage(Handler.java:95)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.os.Looper.loop(Looper.java:148)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	at android.app.ActivityThread.main(ActivityThread.java:5417)
12-12 10:28:39.072: E/AndroidRuntime(2307): 	... 3 more
Comment 1 Chris King 2016-12-21 23:01:54 UTC
Ahmed, sorry to hear you're having this issue; thanks for reporting this. If you're still blocked by this issue would you be willing to provide a reduced reproduction on the latest version of XF? Issues with reduced reproductions are given priority during triage.

Warm regards,
XFT
Comment 2 David Ortinau [MSFT] 2017-06-17 01:52:57 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!