EditText et = null; et.setOnFocusChangeListener(new OnFocusChangeListener(){ @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus){ et.setText(""); } } });
或者:
android:selectAllOnFocus="true"
这个是获得焦点后选中所有内容
米娅的android之旅
android开发群群号:84926730 |