myText.setInputType(InputType.TYPE_NULL); myText.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { myText.setInputType(InputType.TYPE_CLASS_TEXT); myText.onTouchEvent(event); // call native handler return true; // consume touch even } });其中:
myText.setInputType(InputType.TYPE_CLASS_TEXT);