Example usage for android.database Cursor getColumnIndex

List of usage examples for android.database Cursor getColumnIndex

Introduction

In this page you can find the example usage for android.database Cursor getColumnIndex.

Prototype

int getColumnIndex(String columnName);

Source Link

Document

Returns the zero-based index for the given column name, or -1 if the column doesn't exist.

Usage

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getPoster(Cursor c) {
    return c.getString(c.getColumnIndex(MovieContract.COLUMN_POSTER));
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getGenres(Cursor c) {
    return c.getString(c.getColumnIndex(MovieContract.COLUMN_GENRES));
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getTitle(Cursor c) {
    return c.getString(c.getColumnIndex(MovieContract.COLUMN_TITLE));
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getReleaseDate(Cursor c) {
    return c.getString(c.getColumnIndex(MovieContract.COLUMN_RELEASE_DATE));
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getPlot(Cursor c) {
    return c.getString(c.getColumnIndex(MovieContract.COLUMN_PLOT));
}

From source file:Main.java

public static String getThumbnailPathForLocalFile(Context context, Uri fileUri) {

    long fileId = getFileId(context, fileUri);
    MediaStore.Video.Thumbnails.getThumbnail(context.getContentResolver(), fileId,
            MediaStore.Video.Thumbnails.MICRO_KIND, null);

    Cursor thumbCursor = null;
    try {/*from w w w  . j  a  v a 2s. c o m*/
        thumbCursor = context.getContentResolver().query(MediaStore.Video.Thumbnails.EXTERNAL_CONTENT_URI,
                thumbColumns, MediaStore.Video.Thumbnails.VIDEO_ID + " = " + fileId, null, null);

        if (thumbCursor.moveToFirst()) {
            String thumbPath = thumbCursor
                    .getString(thumbCursor.getColumnIndex(MediaStore.Video.Thumbnails.DATA));
            return thumbPath;
        }

    } finally {
    }

    return null;
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getBackdrop(Cursor data) {
    return data.getString(data.getColumnIndex(MovieContract.COLUMN_BACKDROP_PATH));
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getLength(Cursor cursor) {
    return cursor.getString(cursor.getColumnIndex(MovieContract.COLUMN_LENGTH));
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

public static String getBudget(Cursor cursor) {
    return cursor.getString(cursor.getColumnIndex(MovieContract.COLUMN_BUDGET));
}

From source file:com.example.igorklimov.popularmoviesdemo.helpers.Utility.java

private static String getMovieId(Cursor cursor) {
    return cursor.getString(cursor.getColumnIndex(MovieContract.COLUMN_MOVIE_ID));
}