Use the built-in handler instead of allocating another one.

Change-Id: Ia2e5db99b751d3f299c4a9b587ef718212bd8161
This commit is contained in:
Joe Onorato
2010-06-01 08:17:58 -07:00
parent f551054055
commit 1a86dd10c1

View File

@@ -25,7 +25,6 @@ import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.format.DateFormat;
@@ -49,7 +48,6 @@ import com.android.internal.R;
* minutes.
*/
public class Clock extends TextView {
private final Handler mHandler = new Handler();
private boolean mAttached;
private Calendar mCalendar;
private String mClockFormatString;
@@ -86,7 +84,7 @@ public class Clock extends TextView {
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
getContext().registerReceiver(mIntentReceiver, filter, null, mHandler);
getContext().registerReceiver(mIntentReceiver, filter, null, getHandler());
}
// NOTE: It's safe to do these after registering the receiver since the receiver always runs