diff --git a/mobile/android/base/home/BrowserSearch.java b/mobile/android/base/home/BrowserSearch.java index e23c66036c2..744a48d8491 100644 --- a/mobile/android/base/home/BrowserSearch.java +++ b/mobile/android/base/home/BrowserSearch.java @@ -93,7 +93,7 @@ public class BrowserSearch extends HomeFragment private LinearLayout mView; // The list showing search results - private ListView mList; + private HomeListView mList; // Client that performs search suggestion queries private volatile SuggestClient mSuggestClient; @@ -205,7 +205,7 @@ public class BrowserSearch extends HomeFragment // All list views are styled to look the same with a global activity theme. // If the style of the list changes, inflate it from an XML. mView = (LinearLayout) inflater.inflate(R.layout.browser_search, container, false); - mList = (ListView) mView.findViewById(R.id.home_list_view); + mList = (HomeListView) mView.findViewById(R.id.home_list_view); return mView; } @@ -239,6 +239,16 @@ public class BrowserSearch extends HomeFragment } }); + mList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { + @Override + public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { + // Account for the search engines + position -= getSuggestEngineCount(); + + return mList.onItemLongClick(parent, view, position, id); + } + }); + final ListSelectionListener listener = new ListSelectionListener(); mList.setOnItemSelectedListener(listener); mList.setOnFocusChangeListener(listener);