private void reorderSpinners(){
  mSpinners.removeAllViews();
  char[] order=DateFormat.getDateFormatOrder(mContext);
  final int spinnerCount=order.length;
  for (int i=0; i < spinnerCount; i++) {
switch (order[i]) {
case 'd':
      mSpinners.addView(mDaySpinner);
    setImeOptions(mDaySpinner,spinnerCount,i);
  break;
case 'M':
mSpinners.addView(mMonthSpinner);
setImeOptions(mMonthSpinner,spinnerCount,i);
break;
case 'y':
mSpinners.addView(mYearSpinner);
setImeOptions(mYearSpinner,spinnerCount,i);
break;
default :
throw new IllegalArgumentException(Arrays.toString(order));
}
}
}

private void reorderSpinners ( ) { mSpinners . removeAllViews ( ) ; char [ ] order = DateFormat . getDateFormatOrder ( mContext ) ; final int spinnerCount = order . length ; for ( int i = 0 ; i < spinnerCount ; i ++ ) { switch ( order [ i ] ) { case 'd' : mSpinners . addView ( mDaySpinner ) ; setImeOptions ( mDaySpinner , spinnerCount , i ) ; break ; case 'M' : mSpinners . addView ( mMonthSpinner ) ; setImeOptions ( mMonthSpinner , spinnerCount , i ) ; break ; case 'y' : mSpinners . addView ( mYearSpinner ) ; setImeOptions ( mYearSpinner , spinnerCount , i ) ; break ; default : throw new IllegalArgumentException ( Arrays . toString ( order ) ) ; } } }
reorders the spinners according to the date format that is explicitly set by the user and if no such is set fall back to the current locale ' s default format .
