Code example for TimePicker

Methods: setCurrentHoursetCurrentMinutesetIs24HourViewsetOnTimeChangedListener

0
	 * @see android.preference.DialogPreference#onCreateDialogView() 
	 */ 
	@Override 
	protected View onCreateDialogView() {
  
		TimePicker tp = new TimePicker(getContext());
		tp.setIs24HourView(true);
		tp.setOnTimeChangedListener(this);
  
		int h = getHour();
		int m = getMinute();
		if (h >= 0 && m >= 0) {
			tp.setCurrentHour(h);
			tp.setCurrentMinute(m);
		} 
  
		return tp;
	} 
  
	/* 
Stop searching for code, let great code find you!  Add Codota to your java IDE