Code example for Cursor

Methods: getColumnIndexOrThrow

0
        // Check for database errors 
        if (data == null) {
            return; 
        } 
 
        mGenreIdIndex = data.getColumnIndexOrThrow(Audio.Genres._ID);
        mGenreNameIndex = data.getColumnIndexOrThrow(Audio.Genres.NAME);
        mGenreAdapter.changeCursor(data);
        mCursor = data;
    } 
 
    @Override 
    public void onLoaderReset(Loader<Cursor> loader) {
        if (mGenreAdapter != null)
            mGenreAdapter.changeCursor(null);
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        outState.putAll(getArguments() != null ? getArguments() : new Bundle());
Contextual code suggestions in your IDE  Get Codota for Java