How to show the old android timePicker? the one that appears only the numbers

0

I'm using a code from the android documentation itself to create the timepicker as a dialog, but it's popping up like this

AndIwantittoappearlikethis

Classthatcreatestimepicker

publicclassTimePickerFragmentextendsDialogFragmentimplementsTimePickerDialog.OnTimeSetListener{@OverridepublicDialogonCreateDialog(BundlesavedInstanceState){//UsethecurrenttimeasthedefaultvaluesforthepickerfinalCalendarc=Calendar.getInstance();inthour=c.get(Calendar.HOUR_OF_DAY);intminute=c.get(Calendar.MINUTE);//CreateanewinstanceofTimePickerDialogandreturnitreturnnewTimePickerDialog(getActivity(),this,hour,minute,DateFormat.is24HourFormat(getActivity()));}publicvoidonTimeSet(TimePickerview,inthourOfDay,intminute){//Dosomethingwiththetimechosenbytheuser}}

CODEINVALIDINGTHETIMEPICKERTHROUGHTHEBUTTONCLICK

publicvoidshowTimePickerDialog(Viewv){DialogFragmentnewFragment=newTimePickerFragment();newFragment.show(getSupportFragmentManager(),"timePicker");
}
    
asked by anonymous 29.03.2017 / 01:02

1 answer

2

In%% of TimePickerFragment, return the TimePickerDialog created this way:

return new TimePickerDialog(getActivity(), AlertDialog.THEME_HOLO_DARK, this, hour, minute,
                            DateFormat.is24HourFormat(getActivity()));

If you are using TimePicker, use the onCreateDialog()

Clock:

android:timePickerMode="clock"

Spinner:

android:timePickerMode="spinner"
    
29.03.2017 / 01:25