Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
I have a Label in a ListView's Header, when longpressing the Label's text the app crashes:
System.NullReferenceExceptionObject reference not set to an instance of an object
at Xamarin.Forms.Platform.Android.CellAdapter.HandleContextMode (Android.Views.View view, Int32 position) <0xd80ba9b0 + 0x001f7> in <filename unknown>:0
at Xamarin.Forms.Platform.Android.CellAdapter.OnItemLongClick (Android.Widget.AdapterView parent, Android.Views.View view, Int32 position, Int64 id) <0xd80ba818 + 0x0006b> in <filename unknown>:0
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) <0xd80ba778 + 0x00091> in <filename unknown>:0
at (wrapper dynamic-method) System.Object:a935b9ed-9547-4922-ae8f-1ea2c25b71ed (intptr,intptr,intptr,intptr,int,long)
Verified on Emulator with Android 5.1 using Xamarin.Forms 2.1.0-pre2
A reproduction project would be appreciated in helping to investigate the issue.
Sorry, of course. Here you go:
1) Compile & Launch Android app
2) Longpress the Label in the Header
3) App crashes with the above mentioned exception
The label is a FixedLabel with a custom renderer.
I found out the crash only occurs if enabling TextSelection on a TextView:
Created attachment 14741 [details]
Sample project for crash on android
I found another case where this also happens:
I just added the feature to click on links in our app through the custom label:
this.TextView.MovementMethod = LinkMovementMethod.Instance;
This causes the exact same crash as SetTextIsSelectable(true).
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. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.