KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a DatePicker where I disabled the SpinnerView and now only use the CalendarView. But it starts with the sunday and I would like to use monday as the first day of the week. How can I change that? I guessed that the first day would depend on the phones settings but on my swiss phone its still wrong... I haven't found any set Method or any XML command. <DatePicker android:id="@+id/date_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" /> and DatePicker datePicker = (DatePicker) convertView.findViewById(R.id.date_picker); datePicker.setSpinnersShown(false); ------------EDIT:------------ I tried to change the locale: Locale.setDefault(Locale.GERMAN); But that didn't change anything ether. So I read the android-17.android.widget.DatePicker.java where I found out: public DatePicker(Context context, AttributeSet attrs, int defStyle) { //... // initialization based on locale setCurrentLocale(Locale.getDefault()); //... } /** * Sets the current locale. * * @param locale The current locale. */ private void setCurrentLocale(Locale locale) { if (locale.equals(mCurrentLocale)) { return; } mCurrentLocale = locale; mTempDate = getCalendarForLocale(mTempDate, locale); mMinDate = getCalendarForLocale(mMinDate, locale); mMaxDate = getCalendarForLocale(mMaxDate, locale); mCurrentDate = getCalendarForLocale(mCurrentDate, locale); mNumberOfMonths = mTempDate.getActualMaximum(Calendar.MONTH) + 1; mShortMonths = new String[mNumberOfMonths]; for (int i = 0; i < mNumberOfMonths; i++) { mShortMonths[i] = DateUtils.getMonthString(Calendar.JANUARY + i, DateUtils.LENGTH_MEDIUM); } } /** * Gets a calenda
Tags (comma-separated)
Save Edits
Cancel