List of usage examples for android.widget TimePicker getContext
@ViewDebug.CapturedViewProperty public final Context getContext()
From source file:org.videolan.vlc.gui.TimePickerDialogFragment.java
@Override public void onTimeSet(TimePicker view, int hourOfDay, int minute) { if (!setTime) { //workaround for weird ICS&JB bug setTime = true;// w w w . j a v a2 s. com return; } Calendar currentTime = Calendar.getInstance(); Calendar sleepTime = Calendar.getInstance(); sleepTime.set(Calendar.HOUR_OF_DAY, hourOfDay); sleepTime.set(Calendar.MINUTE, minute); sleepTime.set(Calendar.SECOND, 0); switch (action) { case ACTION_SLEEP: if (sleepTime.before(currentTime)) sleepTime.roll(Calendar.DATE, true); AdvOptionsDialog.setSleep(view.getContext(), sleepTime); break; case ACTION_JUMP: long time = (long) ((hourOfDay * 60 + minute) * 60000); LibVLC.getExistingInstance().setTime(time); break; } }