Example usage for android.database Cursor getColumnIndexOrThrow

List of usage examples for android.database Cursor getColumnIndexOrThrow

Introduction

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

Prototype

int getColumnIndexOrThrow(String columnName) throws IllegalArgumentException;

Source Link

Document

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

Usage

From source file:Main.java

public static int getInt(String columnName, Cursor cursor) {
    return cursor.getInt(cursor.getColumnIndexOrThrow(columnName));
}

From source file:Main.java

public static long getLong(String columnName, Cursor cursor) {
    return cursor.getLong(cursor.getColumnIndexOrThrow(columnName));
}

From source file:Main.java

public static String getString(String columnName, Cursor cursor) {
    return cursor.getString(cursor.getColumnIndexOrThrow(columnName));
}

From source file:Main.java

public static double getDouble(String columnName, Cursor cursor) {
    return cursor.getDouble(cursor.getColumnIndexOrThrow(columnName));
}

From source file:Main.java

public static short getShort(Cursor cursor, String columnName) {
    return cursor.getShort(cursor.getColumnIndexOrThrow(columnName));
}

From source file:Main.java

private static File getCursorFile(Cursor cursor, String column) {
    return new File(cursor.getString(cursor.getColumnIndexOrThrow(column)));
}

From source file:Main.java

private static String getCursorString(Cursor cursor, String column) {
    return cursor.getString(cursor.getColumnIndexOrThrow(column));
}

From source file:Main.java

public static byte[] getBlob(Cursor cursor, String columnName) {
    return cursor.getBlob(cursor.getColumnIndexOrThrow(columnName));
}

From source file:Main.java

public static long getLong(Cursor cursor, String columnName) {
    return cursor.getLong(cursor.getColumnIndexOrThrow(columnName));
}

From source file:Main.java

public static String getString(Cursor cursor, String columnName) {
    return cursor.getString(cursor.getColumnIndexOrThrow(columnName));
}