Code example for BaseAdapter

Methods: isEmptynotifyDataSetChanged

0
            BaseAdapter adapter = mAdapter.get();
            if (adapter == null) {
                // The adapter is no longer in use 
                return; 
            } 
            if (!adapter.isEmpty()) {
                adapter.notifyDataSetChanged();
            } else { 
                // The adapter is empty or no longer in use. 
                // It is important that BaseAdapter#notifyDataSetChanged() 
                // is not called when the adapter is empty because this 
                // may indicate that the data is valid when it is not. 
                // For example: when the adapter cursor is deactivated. 
            } 
        } 
    } 
 
    private static final class BaseExpandableListAdapterCallback implements ImageCallback { 
 
        private final WeakReference<BaseExpandableListAdapter> mAdapter;