Code example for Handler

Methods: hasMessagesobtainMessage

0
     * <p> 
     * Binding late is preferred as any custom preference types created in 
     * {@link #onCreate(Bundle)} are able to have their views recycled. 
     */ 
    private void postBindPreferences() { 
        if (mHandler.hasMessages(MSG_BIND_PREFERENCES)) return;
        mHandler.obtainMessage(MSG_BIND_PREFERENCES).sendToTarget();
    } 
     
    private void bindPreferences() { 
        final PreferenceScreen preferenceScreen = getPreferenceScreen();
        if (preferenceScreen != null) {
            preferenceScreen.bind(lv);
        } 
    } 
     
    /** 
     * Creates the {@link PreferenceManager}. 
     *  
     * @return The {@link PreferenceManager} used by this activity. 
     */