Questions tagged [android-datepicker]

Android DatePicker is a widget for selecting a date. The date can be selected by a year, month, and day spinners or a CalendarView. The set of spinners and the calendar view are automatically synchronized.

Android DatePicker is a widget for selecting a date. The date can be selected by a year, month, and day spinners or a CalendarView. The set of spinners and the calendar view are automatically synchronized.

Android DatePickerDialog is a dialog that hosts a DatePicker widget.

786 questions
8
votes
1 answer

How to change Number Picker center text color in Android

I have implemented a custom Date Picker wherein I need to have custom colors for the number picker (Date picker uses Number picker inside) inside it as follows: With the help of this answer I could make it look like this: But as you see the actual…
Rajkiran
  • 15,845
  • 24
  • 74
  • 114
8
votes
2 answers

How to transfer the formatted date string from my DatePickerFragment?

Following the official doc http://developer.android.com/guide/topics/ui/controls/pickers.html#DatePicker. I have used just the same code, and added only the result formatting in the onDateSet method: public class DatePickerFragment extends…
pepr
  • 20,112
  • 15
  • 76
  • 139
7
votes
1 answer

set calendar constraints of 180 days for materialDatePicker

I am using MaterialDatePicker for Android (Kotlin) and need to ensure that the start and end date is no more than 180 days apart. How do I write the constraints for this?
7
votes
6 answers

I want to use digital date picker dialog and time picker dialog

I want to use the digital date picker dialog and time picker dialog, I have written the code and my picker dialogs are working, but I want them in another format. Currently, my time picker and date picker dialog are in this format: I want them…
bipin
  • 1,091
  • 4
  • 12
  • 30
7
votes
2 answers

How to set a minimum and maximum limit for a date picker in android?

I'm working on an app in which i'm using a custom date and time picker. I've created a dialog box and inside that i'm showing date and time picker respectively now I want to set a minimum and maximum limit for the date picker. Such as one should not…
ManishNegi
  • 569
  • 1
  • 6
  • 19
6
votes
2 answers

How to set Android DatePicker mode to spinner for APIs below level 21

I want to display a DatePickerDialog with mode spinner instead of calendar. In my styles.xml, I tried to put this attribute but it says that the minimum SDK version I should be using is API 21. spinner I…
racumin
  • 392
  • 2
  • 3
  • 17
6
votes
2 answers

How to remove extra space space in DatePickerDialog (seen on Android M & N)?

I'm seeing an extra space on the right of the DatePickerDialog, only on Android M & N builds. It's not observed on L based build. Here's the screenshot: Has anyone faced this problem ? This is the implementation of DatePickerFragment: public…
Monu Surana
  • 694
  • 1
  • 6
  • 20
6
votes
1 answer

Date picker inside custom dialog in Android

I wanted to use date picker inside my custom dialog. On button click calendar will open to choose date for user. I have Button inside my customDilaog class and on that button click I want to open calendar view. My app crashes if click this button. I…
Ashish Kudale
  • 1,230
  • 1
  • 27
  • 51
6
votes
2 answers

Using Kit Kat DatePicker in Lollipop Device

I'm trying to show a DatePickerDialog in my apps. But I realized that the DatePickerDialog that show up depends on the phone OS. My question is how can I show KitKat style DatePicker in Lollipop OS? I know this is possible because some apps like…
6
votes
4 answers

Datepicker gives time not between exception

I'm using a datepicker and want to set the min date to today and the max date to today one year ahead. I do this like: datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000); cal.add(Calendar.YEAR, 1); …
user1007522
  • 7,858
  • 17
  • 69
  • 113
6
votes
3 answers

Two date pickers in same activity android

I have an activity where I need to accept two dates, a start date and an end date. I have two buttons, which when clicked would display the date pickers. After entering the date, I need to store this date using SharedPreferences. I am using this…
Vedavyas Bhat
  • 2,068
  • 1
  • 21
  • 31
6
votes
3 answers

datepicker with different style than activity

I have activities with custom style, I want my activity with a custom title bar so I created below style: