Code example for DatePickerDialog

Methods: setButton, show

0
 
	} 
	 
	public void showTimeDialog() 
	{ 
		DatePickerDialog dialog = new DatePickerDialog(this,  
                    dateListener,  
                    calendar.get(Calendar.YEAR),  
                    calendar.get(Calendar.MONTH),  
                    calendar.get(Calendar.DAY_OF_MONTH));
	//	dialog.setButton(DialogInterface.BUTTON_NEGATIVE, listener); 
		dialog.setButton(DialogInterface.BUTTON_NEGATIVE, "cancel",new  DialogInterface.OnClickListener(){
			@Override 
			public void onClick(DialogInterface dialog, int which) {
				if(which==DialogInterface.BUTTON_NEGATIVE)
				Log.e("ysy", "show time");			}
		}); 
		dialog.show();
	} 
	 
	DatePickerDialog.OnDateSetListener dateListener =   
		    new DatePickerDialog.OnDateSetListener() {   
		        @Override