Bug 30137 - [Android] ListView longtap crashes on Samsung KitKat device.
Summary: [Android] ListView longtap crashes on Samsung KitKat device.
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.2
Hardware: PC Mac OS
: High normal
Target Milestone: ---
Assignee: Seth Rosetter
URL:
Depends on:
Blocks:
 
Reported: 2015-05-15 13:17 UTC by Kent Green [MSFT]
Modified: 2015-06-25 07:41 UTC (History)
6 users (show)

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


Attachments
Logs from customer (454.88 KB, application/zip)
2015-05-15 13:17 UTC, Kent Green [MSFT]
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:
RESOLVED FIXED

Description Kent Green [MSFT] 2015-05-15 13:17:23 UTC
Created attachment 11219 [details]
Logs from customer

===Overview===
From this enterprise desk case:
https://kb.xamarin.com/agent/case/160155

Customer reports that a LongTap on a ListView crashes on device. 

===Observations===
The customer reported they're aware LongTap isn't presently supported, but the expected behavior is that the LongTap is effectively ignored; rather than causing a crash. 

While our initial tests were unable to reproduce the issue, the customer noted the problem specifically on the following device:
Galaxy S4 GT-I9505, Android version 4.4.2

There are a few known issues particular to Samsung devices; so it seemed possible it might be occurring specific to that device. The devices we tested but were *unable* to reproduce the issue are as follows:

1) Samsung Galaxy In Duos - Jelly Bean 4.1.2
2) LG Volt - KitKat 4.4.2
3) Amazon Fire - Android 4.4

===Stacktrace===
The reporting customer sent over the following stacktrace. I'm not recognizing a ton within it myself; but I am seeing references to 'OnItemLongClick'; which seems noteworthy given the customer's report.

> [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) <0x0003c>
> [MonoDroid] at Xamarin.Forms.Platform.Android.CellAdapter.HandleContextMode (Android.Views.View,int) <0x0001f>
> [MonoDroid] at Xamarin.Forms.Platform.Android.CellAdapter.OnItemLongClick (Android.Widget.AdapterView,Android.Views.View,int,long) <0x000af>
> [MonoDroid] at Android.Widget.AdapterView/IOnItemLongClickListenerInvoker.n_OnItemLongClick_Landroid_widget_AdapterView_Landroid_view_View_IJ (intptr,intptr,intptr,intptr,int,long) <0x000b7>
> [MonoDroid] at (wrapper dynamic-method) object.a3d00b78-0769-4074-a930-14796fcb46df (intptr,intptr,intptr,intptr,int,long) <0x00083>
> [AndroidRuntime] Shutting down VM
> [AndroidRuntime] FATAL EXCEPTION: main
> [AndroidRuntime] Process: com.docuware.genericconnector, PID: 27802
> [AndroidRuntime] java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
> [AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
> [AndroidRuntime] at dalvik.system.NativeStart.main(Native Method)
> [AndroidRuntime] Caused by: java.lang.reflect.InvocationTargetException
> [AndroidRuntime] at java.lang.reflect.Method.invokeNative(Native Method)
> [AndroidRuntime] at java.lang.reflect.Method.invoke(Method.java:515)
> [AndroidRuntime] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
> [AndroidRuntime] ... 2 more
> [AndroidRuntime] Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
> [AndroidRuntime] at Xamarin.Forms.Platform.Android.CellAdapter.set_ContextView (Android.Views.View) <0x0003c>
> [AndroidRuntime] at Xamarin.Forms.Platform.Android.CellAdapter.HandleContextMode (Android.Views.View,int) <0x0001f>
> [AndroidRuntime] at Xamarin.Forms.Platform.Android.CellAdapter.OnItemLongClick (Android.Widget.AdapterView,Android.Views.View,int,long) <0x000af>
> [AndroidRuntime] at Android.Widget.AdapterView/IOnItemLongClickListenerInvoker.n_OnItemLongClick_Landroid_widget_AdapterView_Landroid_view_View_IJ (intptr,intptr,intptr,intptr,int,long) <0x000b7>
> [AndroidRuntime] at (wrapper dynamic-method) object.a3d00b78-0769-4074-a930-14796fcb46df (intptr,intptr,intptr,intptr,int,long) <0x00083>
> [AndroidRuntime]
> [AndroidRuntime] at md5530bd51e982e6e7b340b73e88efe666e.CellAdapter.n_onItemLongClick(Native Method)
> [AndroidRuntime] at md5530bd51e982e6e7b340b73e88efe666e.CellAdapter.onItemLongClick(CellAdapter.java:43)
> [AndroidRuntime] at android.widget.AbsListView.performLongPress(AbsListView.java:3575)
> [AndroidRuntime] at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:3521)
> [AndroidRuntime] at android.os.Handler.handleCallback(Handler.java:733)
> [AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:95)
> [AndroidRuntime] at android.os.Looper.loop(Looper.java:157)
> [AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:5356)
> [AndroidRuntime] ... 5 more


===Version info===
Xamarin.Forms 1.4.2.6359

===Additional Info===
Adding logs from the customer. 

They also included a sample, which I will add separately as a private attachment shortly.
Comment 2 Chris King 2015-05-19 13:14:14 UTC
Made an inquiry if we have the device in question.
Comment 3 Prashant Cholachagudda 2015-05-26 06:05:01 UTC
Note that a single long tap does not cause the crash, here are the steps to reproduce the crash:

- Long tap on an list item
- Dont lift up the finger
- Scroll down with the finger
- Lift up the finger
- Long tap on a different item
- Crash

I was able to crash the app on Moto E
Comment 4 Stephane Delcroix 2015-06-25 07:41:37 UTC
this will be fixed in 1.4.4