clear the contents of the editText when long press on Back Space Key
问题 Because my editext is the string format it doesn't clear all the text when i long press on the backspace key. so i am looking for solution to clear all text when long press on the backspace key ?? 回答1: Try this @Override public boolean onKeyLongPress(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_DEL) { textView.setText(""); return true; } return super.onKeyLongPress(keyCode, event); 回答2: You can do it by overriding onKeyLongPress() like @Override public boolean onKeyLongPress