EditText birthday = (EditText) findViewById(R.id.birthday_text_regis);
birthday.setOnTouchListener(new BirthClickListener());
// 生日编辑框
class BirthClickListener implements OnTouchListener{
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
int inType = birthday.getInputType(); // backup the input type
birthday.setInputType(InputType.TYPE_NULL); // disable soft input
birthday.onTouchEvent(event); // call native handler
birthday.setInputType(inType); // restore input type
birthday.setSelection(birthday.getText().length());
return true;
}
}
birthday.setOnTouchListener(new BirthClickListener());
// 生日编辑框
class BirthClickListener implements OnTouchListener{
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
int inType = birthday.getInputType(); // backup the input type
birthday.setInputType(InputType.TYPE_NULL); // disable soft input
birthday.onTouchEvent(event); // call native handler
birthday.setInputType(inType); // restore input type
birthday.setSelection(birthday.getText().length());
return true;
}
}