Questions tagged [timepickerdialog]

55 questions
10
votes
3 answers

TimePicker with Spinners?

I'm trying to build a TimePickerDialog but unfortunately the Time Picker that comes up is extremely cumbersome to Use : Is there any way to build a timepicker like the old ones that Android use to have like below : My code is as follows : …
user5530425
9
votes
1 answer

TimePickerDialog in jetpack compose

I have this code from the material3 documentation for compose: import androidx.compose.foundation.layout.Box import androidx.compose.material3.Button import androidx.compose.material3.SnackbarHost import…
DeKekem
  • 589
  • 10
  • 20
5
votes
1 answer

How to set a custom title on time picker?

I'm making a date picker with a title but the view its ugly because there is no margin bottom, how can i make a margin to make it little pretty? As you can see it's very ugly. My code: if(endTime.isEmpty() || startTime.isEmpty()){ int…
GusDev
  • 255
  • 6
  • 20
4
votes
1 answer

Alternative way to access TimePickerDialog's NumberPicker objects than Class.forName

I am trying to create a custom TimePickerDialog with custom intervals for hours and minutes, and managed to solve it by using the answer from this question. The problem is that Android Studio displays the following warning: Accessing internal APIs…
Developer
  • 736
  • 7
  • 30
4
votes
1 answer

Android API 21+ - hide analog clock in TimePickerDialog programmatically

Since Android 5.0, TimePickerDialog displays an analog clock by default. How can I hide the analog clock(change display mode) by code? To obtain similar result of TimePicker in xml: ...android:timePickerMode="spinner">
T D Nguyen
  • 7,054
  • 4
  • 51
  • 71
3
votes
0 answers

TimePickerDialog onclick() on BUTTON_POSITIVE stopped working post Oreo

I am having a weird issue where in the onClick() listener on TimePickerDialog has stopped working on Android 8.0. Here is my code: _timePickerDialog.setButton(DialogInterface.BUTTON_POSITIVE,"SET", new DialogInterface.OnClickListener()…
3
votes
1 answer

TimePickerDialog disable hours change when scrolling minutes

Android Timepickerdialog is changing hours illogically when I'm scrolling minutes. I have set the minute interval to 30 minutes in my timepickerdialog so the values for minutes are 00 and 30. For example when I set the hours to 00 and change minutes…
Nahka
  • 416
  • 1
  • 6
  • 16
3
votes
2 answers

TimePickerDialog with old style and different color

I created a TimePickerDialog and changed the default color. In addition, I would like to change the style to a different style. I couldn't find a way to change the color and also the style at the same time. This is how I created my…
Yuval Levy
  • 2,397
  • 10
  • 44
  • 73
3
votes
2 answers

Android: DatePickerDialog and TimePickerDialog not passing selection

There is a problem with both DatePickerDialog and TimePickerDialog. A user can select a date and a time with the plus or minus buttons. This works. But when the user clicks into the field, he can set a value by keyboard: But this does not work at…
3
votes
8 answers

How to add an Extra zero in time for proper time format

I am using a timepicker to choose the time and then show it in a toast in 24 hour format. I am getting output in toast like "2:6" And I want to get it in proper time format like "02:06". How can I do that.... public void ShowTimePicker(View view) { …
Waqas Khan
  • 55
  • 1
  • 10
3
votes
1 answer

DatePickerDialog and TimePickerDialog Are Not Working at the Same Time

I'm new to Android. I've been developing my first application which is a reminder. In the reminder I have created two EditTexts, one for choosing time from TimePickerDialog and the other for choosing date from DatePickerDialog. when I include both…
Mark
  • 33
  • 6
2
votes
1 answer

Title in TimePickerDialog

I'm trying to set a title to my TimePickerDialog. I've seen couple of examples but I can't achieve to get the result I want. This is what I'm trying to get. But impossible to know how can I place a title like "Please select a date" in the…
schtipoun
  • 423
  • 3
  • 9
2
votes
0 answers

How to hide the icon in TimePickerDialog?

Is it possible to hide the keyboard icon in timepicker dialog?
JAC
  • 119
  • 12
2
votes
0 answers

TimePickerDialog Exception

description: I use TimePickerDialog , when I click my Button , an exception occurred. Here is my Source Code: private TimePickerDialog.OnTimeSetListener mTimeSetListener = new TimePickerDialog.OnTimeSetListener() { public void…
sunpeijie
  • 115
  • 1
  • 10
2
votes
2 answers

java.text.ParseException: Unparseable date: "" (at offset 0) error for timepickerdialog

Hi this is my first time developing an simple Android-based application. I need to validate my starting time and ending time, which means ending time must not be less than or equal to starting time. I'm using an EditText to prompt a timepicker…
Wendy Goh
  • 33
  • 5
1
2 3 4