Code example for TimePicker

Methods: setCurrentHoursetCurrentMinute

0
	public void onTimeChanged(TimePicker arg0, int hourOfDay, int minute) {
		updateTitle(hourOfDay, minute);
	} 
	 
	public void updateTime(int hourOfDay, int minutOfHour) {
        picker.setCurrentHour(hourOfDay);
        picker.setCurrentMinute(minutOfHour);
    } 
	 
	private void updateTitle(int hour, int minute) {
        calendar.set(Calendar.HOUR_OF_DAY, hour);
        calendar.set(Calendar.MINUTE, minute);
        setTitle(dateFormat.format(calendar.getTime()));
    } 
	 
	@Override 
    public Bundle onSaveInstanceState() {
        Bundle state = super.onSaveInstanceState();
        state.putInt(HOUR, picker.getCurrentHour());
        state.putInt(MINUTE, picker.getCurrentMinute());
Connect your IDE to all the code out there  Get Codota for Java