Code example for TimePicker

Methods: setCurrentHoursetCurrentMinute

0
 
    @Override 
    protected void onBindDialogView(View v) {
        super.onBindDialogView(v);
 
        picker.setCurrentHour(lastHour);
        picker.setCurrentMinute(lastMinute);
    } 
 
    @Override 
    protected void onDialogClosed(boolean positiveResult) {
        super.onDialogClosed(positiveResult);
 
        if (positiveResult) {
            lastHour=picker.getCurrentHour();
            lastMinute=picker.getCurrentMinute();
 
            String time=String.valueOf(lastHour)+":"+String.valueOf(lastMinute);
 
            if (callChangeListener(time)) {
                persistString(time);