Tuesday 12 February 2013

Set DateListener to DatePicker Dialog in Android ?



// Listener for DatePickerDialog
OnDateSetListener dateListener = new OnDateSetListener() {

public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
// TODO Auto-generated method stub

int month = monthOfYear + 1;

Toast.makeText(DatePickerDialogDemoActivity.this,
dayOfMonth + "-" + month + "-" + year,
Toast.LENGTH_LONG).show();
}
};


No comments:

Post a Comment