Example usage for android.widget TimePicker TimePicker

List of usage examples for android.widget TimePicker TimePicker

Introduction

In this page you can find the example usage for android.widget TimePicker TimePicker.

Prototype

public TimePicker(Context context) 

Source Link

Usage

From source file:paarmann.physikprofil.TimePreference.java

@Override
protected View onCreateDialogView() {
    _timeView = new TimePicker(this.getContext());
    _timeView.setSaveFromParentEnabled(false);
    _timeView.setSaveEnabled(true);//from w  w w .  j  a v  a  2s . c  om
    _timeView.setIs24HourView(DateFormat.is24HourFormat(this.getContext()));

    return _timeView;
}

From source file:de.escoand.readdaily.ReminderDialogFragment.java

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    TimePicker v = new TimePicker(getContext());

    settings = PreferenceManager.getDefaultSharedPreferences(getActivity());
    hour = settings.getInt(SETTINGS_HOUR, 9);
    minute = settings.getInt(SETTINGS_MINUTE, 0);

    v.setIs24HourView(true);/*from  w w  w .  jav a2  s .  com*/
    v.setOnTimeChangedListener(this);
    v.setCurrentHour(hour);
    v.setCurrentMinute(minute);

    return new AlertDialog.Builder(getContext()).setView(v).setPositiveButton(R.string.button_ok, this)
            .setNegativeButton(R.string.button_cancel, this).create();
}

From source file:com.github.notizklotz.derbunddownloader.settings.TimePickerPreference.java

@Override
protected View onCreateDialogView() {
    tp = new TimePicker(getContext());
    tp.setIs24HourView(true);
    return tp;
}