删除EditTextView光标所在位置的字符(监听系统的删除事件)

btn.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                View focusView = getCurrentFocus();
                focusView
                        .dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL));
            }
        });


你可能感兴趣的:(Android)