Code example for ArrayList

Methods: addAll, clear

0
 
    /** 
     * Replaces the existing items in the adapter with a given collection 
     */ 
    public void fillWithItems(Collection<SearchResult> items) {
        mItems.clear();
        mItems.addAll(items);
    } 
 
    /** 
     * Appends a given list of SearchResults to the adapter 
     */ 
    public void appendWithItems(Collection<SearchResult> items) {
        mItems.addAll(items);
    } 
}