diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2017-06-28 15:35:37 -0600 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2017-06-28 14:35:37 -0700 |
commit | 6ef847abfa3d65544c672af855c8bb24eedbd335 (patch) | |
tree | 9dc2d73f696a79b3506817bbea724480c277673c /Xamarin.Forms.Platform.Android/Renderers | |
parent | c6c4b7f9be0c2d0aa100d721704bd629b4738d8f (diff) | |
download | xamarin-forms-6ef847abfa3d65544c672af855c8bb24eedbd335.tar.gz xamarin-forms-6ef847abfa3d65544c672af855c8bb24eedbd335.tar.bz2 xamarin-forms-6ef847abfa3d65544c672af855c8bb24eedbd335.zip |
Add disposed check to EnsureLongClickCancellation (#1016)
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers')
-rw-r--r-- | Xamarin.Forms.Platform.Android/Renderers/ViewCellExtensions.cs | 5 |
1 files changed, 5 insertions, 0 deletions
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 |