Created
July 2, 2013 08:59
-
-
Save px-amaac/5907764 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SetDurationFragment extends SherlockDialogFragment implements | |
TimePickerDialog.OnTimeSetListener { | |
public static final String TAG = "timepick"; | |
public interface TimeSetListener { | |
void onFinishTimeDialog(int hour, int minute); | |
} | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
TimePickerDialog timePick = new TimePickerDialog(getSherlockActivity(), | |
this, 0, 0, true); | |
timePick.setTitle(R.string.meter_duration); | |
return timePick; | |
} | |
public void onTimeSet(TimePicker view, int hourOfDay, int minute) { | |
TimeSetListener finshed = (TimeSetListener) getSherlockActivity(); | |
finshed.onFinishTimeDialog(hourOfDay, minute); | |
this.dismiss(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment