android 监听EditText 复制 粘贴 等操作
@Override
public boolean onTextContextMenuItem(int id) {
if (id == android.R.id.paste) {
//调用剪贴板
ClipboardManager clip = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
//改变剪贴板中Content
if (clip != null)
clip.setText("改变剪贴板中Content" + clip.getText());
}
return super.onTextContextMenuItem(id);
}
网友评论