0

I'm using this method to get MONTH and DAY_OF_WEEK names. On almost all devices it's working perfectly, but on my LG P500 with Android version 2.3.7 instead of the display name I get a number. My conclusion is that the number returned is in fact the index of the DAY or MONTH...for example Wednesday returns 4, Thursday 5 etc... the same thing happend for months display names.

Also it is the same for SHORT and LONG styles. Anyone knows why this happens?

EDIT:

private Locale locale

@Override
public void onCreate(Bundle savedInstanceState) {

   super.onCreate(savedInstanceState);
   this.user = PreferenceHelper.getUser(getActivity());
   this.club = PreferenceHelper.getSelectedClub(getActivity());
   this.locale = new Locale(PreferenceHelper.getLocale(getActivity()));
}



@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    String monthName = c.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, locale);

}

I save my locale in the preference. It should always return an locale. I also tried making my locale:

Locale locale = new Locale("abc");

but it looks like it returns in English if the locale is not valid (on devices that display text and not a number)

Tooroop
  • 1,824
  • 1
  • 20
  • 31

0 Answers0