问题
I am trying to show context menu (copy-paste options) for MultiAutoCompleteTextView when clicked on button. Here is what I have tried but did not work.
mButton.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
// the below line didn't work either.
//mAutoCompleteTextView.showContextMenu();
mAutoCompleteTextView.performLongClick();
return true;
}
});
Is there any way to show context menu? Menu is shown when I long press MultiAutoCompleteTextView, but I need to achieve same functionality when long clicked on any other view on the activity.
来源:https://stackoverflow.com/questions/47195345/how-to-show-copy-paste-options-context-menu-for-multiautocompletetextview-on-b