From 8fa75e03f74f7dbca3368dd8877d9f94e6335f18 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Fri, 23 Oct 2015 10:49:23 -0400 Subject: [PATCH] Let the framework handle long clicks If we manually propagate long click events, the framework can't include coordinate information and we'll only be able to show a modal dialog. Since the default long-click behavior is to show the context menu, just let the framework handle it. Bug: 25214386 Change-Id: I32e14b326ac91cc5a9c2bf7581325daaba34298e --- src/com/android/settings/wifi/AccessPointPreference.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/com/android/settings/wifi/AccessPointPreference.java b/src/com/android/settings/wifi/AccessPointPreference.java index ce2601c3675..061055ad17b 100644 --- a/src/com/android/settings/wifi/AccessPointPreference.java +++ b/src/com/android/settings/wifi/AccessPointPreference.java @@ -101,13 +101,7 @@ public class AccessPointPreference extends Preference { if (mFragment != null) { view.itemView.setOnCreateContextMenuListener(mFragment); view.itemView.setTag(this); - view.itemView.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - view.itemView.showContextMenu(); - return true; - } - }); + view.itemView.setLongClickable(true); } if (mAccessPoint == null) { // Used for dummy pref.