1

I'm using the DatePickerDialog and it works like a charm. Now I would like to set my own values from 3 string arrays (array.xml) into the datepicker. The reason is that I'm changing the locale inside the app, instead of the entire phone.

Is this possible? Or should I make a custom picker instead of the DatePicker? I searched for it but can't find anything that suits my request.

Cheers!

Edit:

Standard DatePicker have: Jan, Feb, Mar, Apr, May...Dec. But when I change the locale it should change to: (ES) Ene, Feb, Mar, Abr, May...Dic

hugocarlmartin
  • 719
  • 1
  • 8
  • 25

1 Answers1

0

Not sure that I understand, but in the OnCreateDialog() method, just return

  return new DatePickerDialog(getActivity(), this, year, month, day);

With year, month & day the date you want

EDIT : Some bad news : This link shows that there is a method to reorder and change Locale of a DatePicker

but

reorderPickers(String[] months) is private. I think you should have a look at android.widget.DatePicker to understand it and to write your personnal class :)

This method is used to change the datePicker to match with the local phone setting

Community
  • 1
  • 1
Skaard-Solo
  • 682
  • 6
  • 11
  • Bad question maybe. But in the standard datepicker there is Jan, Feb....May, Oct etc. But for ex swedish that would be Maj, Okt and in spanish/french something else. The dateformat is no problem. The strings in the standard datepicker doesn't change on locale inside the app. – hugocarlmartin Aug 20 '13 at 08:04
  • Looks crazy but I will give it a try. :) Thx. – hugocarlmartin Aug 20 '13 at 08:25