Code example for Loader

Methods: getId

1
        return null; 
    } 
 
    @Override 
    public void onLoadFinished(Loader loader, Cursor data) {
        switch (loader.getId()) {
            case LOADER_GROUPS: {
                setData(data);
                break; 
            } 
        } 
    } 
 
    private void setData(Cursor groups) {
        MatrixCursor psuedoGroups = new MatrixCursor(new String[] { "_id", "name" });
        psuedoGroups.newRow().add(-1).add("All Contacts");
        psuedoGroups.newRow().add(-2).add("Favorites");
        mAdapter.changeCursor(new MergeCursor(new Cursor[] { psuedoGroups, groups }));
    } 
 
Connect your IDE to all the code out there  Get Codota for Java