List of usage examples for android.widget ListPopupWindow getSelectedView
public @Nullable View getSelectedView()
From source file:com.duy.pascal.ui.editor.view.CodeSuggestsEditText.java
private void performCompletion(View selectedView, int position, long id) { if (isPopupShowing()) { Object selectedItem;/* w w w. j a va 2s .c o m*/ if (position < 0) { selectedItem = mPopup.getSelectedItem(); } else { selectedItem = mAdapter.getItem(position); } if (selectedItem == null) { DLog.w(TAG, "performCompletion: no selected item"); return; } mBlockCompletion = true; try { replaceText(convertSelectionToString(selectedItem)); } catch (Exception ignored) { //something wrong when start app ignored.printStackTrace(); } mBlockCompletion = false; if (mItemClickListener != null) { final ListPopupWindow list = mPopup; if (selectedView == null || position < 0) { selectedView = list.getSelectedView(); position = list.getSelectedItemPosition(); id = list.getSelectedItemId(); } mItemClickListener.onItemClick(list.getListView(), selectedView, position, id); } } if (mDropDownDismissedOnCompletion) { dismissDropDown(); } }