Code example for Handler

Methods: sendEmptyMessage

0
        } 
    } 
 
    private void updateLocked() { 
        mWakeLock.acquire();
        mHandler.sendEmptyMessage(MSG_DOCK_STATE_CHANGED);
    } 
 
    private void handleDockStateChange() { 
        synchronized (mLock) {
            Slog.i(TAG, "Dock state changed: " + mDockState);
 
            // Skip the dock intent if not yet provisioned. 
            final ContentResolver cr = mContext.getContentResolver();
            if (Settings.Global.getInt(cr,
                    Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
                Slog.i(TAG, "Device not provisioned, skipping dock broadcast");
                return; 
            } 
 
            // Pack up the values and broadcast them to everyone