Code example for Adapter

Methods: unregisterDataSetObserver

0
    } 
 
    @Override 
    protected void onDetachedFromWindow() { 
        super.onDetachedFromWindow(); 
        if (adapter != null) adapter.unregisterDataSetObserver(dataSetObserver);
    } 
 
    private void reloadChildViews() { 
        removeAllViews();
 
        if (adapter == null) return;
 
        int count = adapter.getCount();
        for (int position = 0; position < count; ++position) {
            View v = adapter.getView(position, null, this);
            if (v != null) addView(v);
        } 
 
        requestLayout();
    }