From 6ef847abfa3d65544c672af855c8bb24eedbd335 Mon Sep 17 00:00:00 2001 From: "E.Z. Hart" Date: Wed, 28 Jun 2017 15:35:37 -0600 Subject: Add disposed check to EnsureLongClickCancellation (#1016) --- Xamarin.Forms.Platform.Android/Renderers/ViewCellExtensions.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Xamarin.Forms.Platform.Android/Renderers') diff --git a/Xamarin.Forms.Platform.Android/Renderers/ViewCellExtensions.cs b/Xamarin.Forms.Platform.Android/Renderers/ViewCellExtensions.cs index a3b34f62..278e284a 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/ViewCellExtensions.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/ViewCellExtensions.cs @@ -22,6 +22,11 @@ namespace Xamarin.Forms.Platform.Android public static void EnsureLongClickCancellation(this AView view, MotionEvent motionEvent, bool handled, VisualElement element) { + if (view.IsDisposed()) + { + return; + } + if (motionEvent.Action == MotionEventActions.Up && handled && view.LongClickable && element.IsInViewCell()) { // In order for long presses/clicks (for opening context menus) to work in a ViewCell -- cgit v1.2.3