[code]
EditText editText;
DatePickerDialog dialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editText = (EditText) findViewById(R.id.editText1);
editText.setOnTouchListener(this);
dialog = new DatePickerDialog(this,
new OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
// EditText'i doldur...
}
}, 2014, 8, 2);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
if (event.getAction() == MotionEvent.ACTION_DOWN && !dialog.isShowing()) {
dialog.show();
return true;
}
return false;
}
[/code]