Code example for DatePickerDialog

Methods: setMessage

0
 
	// Code extracted from 
	// http://mobile.tutsplus.com/tutorials/android/android-sdk_datepickerdialog/ 
	@Override 
	protected Dialog onCreateDialog(int id) {
		DatePickerDialog dateDlg = new DatePickerDialog(this,
				new DatePickerDialog.OnDateSetListener() {
					public void onDateSet(DatePicker view, int year,
							int monthOfYear, int dayOfMonth) {
						Time chosenDate = new Time();
						chosenDate.set(dayOfMonth, monthOfYear, year);
						long dtDob = chosenDate.toMillis(true);
						CharSequence strDate = DateFormat.format(
								"MMMM dd, yyyy", dtDob);
						Toast.makeText(HostActivity.this,
								"Date picked: " + strDate, Toast.LENGTH_SHORT)
								.show();
					} 
				}, 2011, 0, 1); 
		dateDlg.setMessage("Transaction date");
		return dateDlg;
	} 
 
}