Code example for ListAdapter

Methods: getCountregisterDataSetObserver

0
                // adapter.  It is now time to show it. 
                setListShown(true, getView().getWindowToken() != null); 
            } 
        } 
        updateEmpty(); 
        mAdapter.registerDataSetObserver(new DataSetObserver() {
            @Override 
            public void onChanged() { 
                super.onChanged(); 
 
                updateEmpty(); 
            } 
 
            @Override 
            public void onInvalidated() { 
                super.onInvalidated(); 
 
                updateEmpty(); 
            } 
 
        }); 
    } 
 
    private void updateEmpty() { 
        if(!mLoading && getActivity() != null) {
            if(mAdapter == null || mAdapter.getCount() == 0) {
                setListShown(false, true); 
                mEmptyView.startAnimation(AnimationUtils.loadAnimation(
                        getActivity(), android.R.anim.fade_in));
                mEmptyView.setVisibility(View.VISIBLE);