Code example for TimePicker

Methods: setCurrentHoursetCurrentMinute

     * Sets the current date. 
     * @param year The date year. 
     * @param monthOfYear The date month. 
     * @param dayOfMonth The date day of month. 
    public void updateDateTime(int year, int monthOfYear, int dayOfMonth,
            int hourOfDay, int minutOfHour) {
        mDatePicker.updateDate(year, monthOfYear, dayOfMonth);
    public Bundle onSaveInstanceState() {
        Bundle state = super.onSaveInstanceState();
        state.putInt(YEAR, mDatePicker.getYear());
        state.putInt(MONTH, mDatePicker.getMonth());
Connect your IDE to all the code out there  Get Codota for Java