Articles → Android → TimePicker dialog in android

TimePicker dialog in android






Example







Click to Enlarge



@Nullable
@Override
protected Dialog onCreateDialog(int id) {
       return new TimePickerDialog(EditTextDemo.this,
               new TimePickerDialog.OnTimeSetListener() {
                   @Override
                   public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
                       TextView txtView = (TextView)findViewById(R.id.tvGetDate);

                       txtView.setText(hourOfDay + ":" + minute);
                   }
               } , 12, 24, true);
}




showDialog(0);



Output





Click to Enlarge




Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, November 25, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250