File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -135,13 +135,11 @@ public void onChange(boolean selfChange, Uri uri) {
135135 private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver () {
136136 @ Override
137137 public void onReceive (Context context , Intent intent ) {
138- if (mTimeZone == null ) {
139- if (intent .getAction ().equals (Intent .ACTION_TIMEZONE_CHANGED )) {
140- final String timeZone = intent .getStringExtra ("time-zone" );
141- createTime (timeZone );
142- }
143- onTimeChanged ();
138+ if (mTimeZone == null && Intent .ACTION_TIMEZONE_CHANGED .equals (intent .getAction ())) {
139+ final String timeZone = intent .getStringExtra ("time-zone" );
140+ createTime (timeZone );
144141 }
142+ onTimeChanged ();
145143 }
146144 };
147145
@@ -406,11 +404,9 @@ private void chooseFormat(boolean handleTicker) {
406404 boolean hadSeconds = mHasSeconds ;
407405 mHasSeconds = DateFormat .hasSeconds (mFormat );
408406
409- if (handleTicker ) {
410- if (hadSeconds != mHasSeconds ) {
411- if (hadSeconds ) getHandler ().removeCallbacks (mTicker );
412- else mTicker .run ();
413- }
407+ if (handleTicker && mAttached && hadSeconds != mHasSeconds ) {
408+ if (hadSeconds ) getHandler ().removeCallbacks (mTicker );
409+ else mTicker .run ();
414410 }
415411 }
416412
You can’t perform that action at this time.
0 commit comments