Code example for Handler

    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;
Connect your IDE to all the code out there  Get Codota for Java