Code example for DatePickerDialog

Methods: setButton, setCancelable

0
		int day = c.get( Calendar.DAY_OF_MONTH );
 
		 
 
		/** Opening the DatePickerDialog window */ 
		dp = new DatePickerDialog( getActivity(), this, year, month, day );
		 
		dp.setButton( DialogInterface.BUTTON_NEGATIVE, "Cancel",
				new DialogInterface.OnClickListener()
					{ 
 
						public void onClick( DialogInterface dialog, int which )
							{ 
 
							if ( which == DialogInterface.BUTTON_NEGATIVE )
								{ 
								 
								dp.cancel();
								 
								} 
							} 
		}); 
		 
		dp.setCancelable( true );
		return dp;
		} 
 
	@Override 
	public void onDateSet( DatePicker view, int year, int month, int day )