Code example for TimePicker

Methods: setCurrentHoursetCurrentMinute

0
	@Override 
	protected void onClick() { 
		int h = getHour();
		int m = getMinute();
		if (h >= 0 && m >= 0) {
			timePicker.setCurrentHour(h);
			timePicker.setCurrentMinute(m);
		} 
		dialog.show();
	} 
 
	OnClickListener onClickListener = new OnClickListener() {
 
		@Override 
		public void onClick(DialogInterface dialog, int which) { 
			switch (which) { 
			case DialogInterface.BUTTON_POSITIVE: 
				timePicker.clearFocus(); 
				result = timePicker.getCurrentHour() + "-" 
						+ timePicker.getCurrentMinute(); 
				persistString(result);