我在用户选择文字时显示PopupWindow,并在onPrepareActionMode
清除菜单中setCustomSelectionActionModeCallback
显示:
menu.clear();
但是在android lollipop中显示一个工具栏时选择一个文本:
我wnat隐藏文本选择上下文操作栏。
final TextView bodyView = (TextView) findViewById(R.id.txt);
bodyView.setCustomSelectionActionModeCallback(new AbsListView.MultiChoiceModeListener() {
@Override
public void onItemCheckedStateChanged(ActionMode actionMode, int i, long l, boolean b) {
}
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
return true;
}
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
menu.clear();
showcustomDialog(bodyView);
return false;
}
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
return false;
}
public void onDestroyActionMode(ActionMode mode) {
}
});