Code example for Loader

Methods: getId

0
     * @param   loader  the loader object 
     * @param   data    the cursor containing DB data 
     */ 
    public void onLoadFinished(Loader<Cursor> loader, Cursor data)
    { 
        switch(loader.getId())
        { 
            case WORDSET_LOADER:
            { 
                // Swap the new cursor in.  (The framework will take care of 
                // closing the old cursor once we return.) 
                mAdapter.swapCursor(data);
 
                break; 
            } 
 
            default: 
            { 
                // An invalid id was passed in 
                return; 
            }