How to programmatically switch DatePicker and TimePicker to display in `Calendar`-mode (or `Clock`-mode, resp.) or `Spinner`-Mode?

1 day ago 1
ARTICLE AD BOX

My Android application is using android.widget.DatePicker and android.widget.TimePicker in several places. I would like to give the user the option to choose whether they want to display that dialog in "Calender-mode" or "Spinner-mode" (or in "Clock-mode" or "Spinner-mode" for TimePicker, resp.).

I found misc. appends (e.g. How to set datePickerMode="spinner" programmatically?) and following these I am trying to use:

datePicker.setSpinnersShown(true); datePicker.setCalendarViewShown(false);

(or vice versa, for the other mode).

But these calls have no effect whatsoever on the rendering of the DatePicker.

What am I missing?

Read Entire Article