Code example for Adapter

Methods: registerDataSetObserver

0
        headers = new ArrayAdapter<String>(context, layoutId);
    } 
 
    public void addSection(String section, Adapter adapter) {
        this.headers.add(section);
        this.sections.put(section, adapter);
         
        // Register an observer so we can call notifyDataSetChanged() when our 
        // children adapters are modified, otherwise no change will be visible. 
        adapter.registerDataSetObserver(mDataSetObserver);
    } 
     
    public void removeObserver() { 
        // Notify all our children that they should release their observers too. 
        for (Map.Entry<String, Adapter> it : sections.entrySet()) {
            if (it.getValue() instanceof ObservableAdapter) {
                ObservableAdapter adapter = (ObservableAdapter)it.getValue();
                adapter.removeObserver();
            } 
        } 
Connect your IDE to all the code out there  Get Codota for Java