Code example for Handler

0
    private AmPm mAmPm;
    private ContentObserver mFormatChangeObserver;
    private int mAttached = 0; // for debugging - tells us whether attach/detach is unbalanced
 
    /* called by system on minute ticks */ 
    private final Handler mHandler = new Handler();
    private BroadcastReceiver mIntentReceiver;
 
    private static final Typeface sBackgroundFont;
    private static final Typeface sForegroundFont;
 
    static { 
        sBackgroundFont = Typeface.createFromFile(SYSTEM_FONT_TIME_BACKGROUND);
        sForegroundFont = Typeface.createFromFile(SYSTEM_FONT_TIME_FOREGROUND);
    } 
 
    private static class TimeChangedReceiver extends BroadcastReceiver {
        private WeakReference<DigitalClock> mClock;
        private Context mContext;
 
        public TimeChangedReceiver(DigitalClock clock) {