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) {
        	try { 
        		if (lv == null) lv = getListView();
        		preferenceScreen.bind(lv);
        	} catch (Exception e) {        		
        	} 
        } 
    } 
     
    /**