diff options
-rw-r--r-- | core/java/android/widget/DateTimeView.java | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java index 443884a..db17df7 100644 --- a/core/java/android/widget/DateTimeView.java +++ b/core/java/android/widget/DateTimeView.java @@ -156,7 +156,7 @@ public class DateTimeView extends TextView { format = getTimeFormat(); break; case SHOW_MONTH_DAY_YEAR: - format = getDateFormat(); + format = DateFormat.getDateInstance(DateFormat.SHORT); break; default: throw new RuntimeException("unknown display value: " + display); @@ -196,21 +196,6 @@ public class DateTimeView extends TextView { return android.text.format.DateFormat.getTimeFormat(getContext()); } - private DateFormat getDateFormat() { - String format = Settings.System.getString(getContext().getContentResolver(), - Settings.System.DATE_FORMAT); - if (format == null || "".equals(format)) { - return DateFormat.getDateInstance(DateFormat.SHORT); - } else { - try { - return new SimpleDateFormat(format); - } catch (IllegalArgumentException e) { - // If we tried to use a bad format string, fall back to a default. - return DateFormat.getDateInstance(DateFormat.SHORT); - } - } - } - void clearFormatAndUpdate() { mLastFormat = null; update(); @@ -283,14 +268,10 @@ public class DateTimeView extends TextView { filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED); filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); context.registerReceiver(mReceiver, filter); - - final Uri uri = Settings.System.getUriFor(Settings.System.DATE_FORMAT); - context.getContentResolver().registerContentObserver(uri, true, mObserver); } void unregister(Context context) { context.unregisterReceiver(mReceiver); - context.getContentResolver().unregisterContentObserver(mObserver); } } } |