List of utility methods to do Cursor Read
int | getInt(Cursor cursor, String columnName) get Int return cursor.getInt(cursor.getColumnIndex(columnName));
|
int | getInt(String columnName) get Int return getInt(cursor, columnName);
|
long | getLong(Cursor c, String column) get Long return c.getLong(c.getColumnIndex(column));
|
long | getLong(Cursor cursor, String columnName) get Long return cursor.getLong(cursor.getColumnIndex(columnName));
|
long | getLong(String column) get Long return cursor.getLong(cursor.getColumnIndex(column));
|
long | getLong(String columnName) get Long return getLong(cursor, columnName);
|
String | getPath(Context context, Uri uri) get Path final String[] projection = { MediaColumns.DATA }; final Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null); final int column_index = cursor .getColumnIndexOrThrow(MediaColumns.DATA); cursor.moveToFirst(); return cursor.getString(column_index); |
String | getString(Cursor c, String column) get String return c.getString(c.getColumnIndex(column));
|
String | getString(String column) get String return cursor.getString(cursor.getColumnIndex(column));
|
String | getPhotoPathByLocalUri(Context context, Intent data) get Photo Path By Local Uri Uri selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = context.getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
...
|