I want an EditText which creates a DatePicker when is pressed. So I write the following code:
mEditInit = (EditText) findViewById(R.id.date_init);
mE
Here is the solution I implemented
mPickDate.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
showDialog(DATE_DIALOG_ID);
return false;
}
});
OR
mPickDate.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
showDialog(DATE_DIALOG_ID);
}
});
See the differences by yourself. Problem is since (like RickNotFred said) TextView to display the date & edit via the DatePicker. TextEdit is not used for its primary purpose. If you want the DatePicker to re-pop up, you need to input delete (1st case) or de focus (2nd case).
Ray