I want to disable EditText contextmenuitem "Clipboard" to open a popup view. Whenever I long press edittext in my app contextmenuitem appears as "Paste, Clipboard". I want to retain the functionality of "Paste" option but "Clipboard" should not work. I have Made a Custom EditText class where I have callbacks for actions such as cut, paste,copy with respect to their Id. But I am unable to diable "Clipboard" function.
override fun onTextContextMenuItem(id: Int): Boolean {
// Do your thing:
val consumed = super.onTextContextMenuItem(id)
when (id) {
R.id.cut -> onCut()
R.id.copy -> onCopy()
R.id.paste, R.id.pasteAsPlainText -> {
onPaste()
}
android.R.id.keyboardView->{}
R.id.accessibilityActionContextClick->{}
R.id.accessibilityActionHideTooltip->{}
R.id.accessibilityActionImeEnter->{}
}
return consumed
}
Below picture shows the EditText options
and this picture shows when I Click Clipboard option