Code example for Adapter

Methods: unregisterDataSetObserver

0
 
    public void setAdapter(Adapter adapter) {
        mAdapter = adapter;
        if (adapter == null) {
            if (mAdapter != null) {
                mAdapter.unregisterDataSetObserver(mObserver);
            } 
            mViews = null;
            mCurrent = -1;
        } else { 
            mObserver = new DataSetObserver() {
                @Override 
                public void onChanged() { 
                    buildViews(); 
                } 
 
                @Override 
                public void onInvalidated() { 
                    mViews.clear();
                } 
            };