ContentProviderで画像パスで検索

Cursor cursor = managedQuery(
    //Table
    MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
    //表示項目、nullだと全て
    null,
    //WHERE句
    MediaStore.Images.Media.DATA + " like ?",
    //WHERE句の値
    new String[] { "%" + imageName + "%" },
    //Sort
    MediaStore.Images.ImageColumns.DATE_TAKEN + " DESC"
);

while (cursor.moveToNext()){
    String filename
    = cursor.getString( cursor.getColumnIndex( MediaStore.Images.Media.DISPLAY_NAME ) );
    String filepath
    = cursor.getString( cursor.getColumnIndex( MediaStore.Images.Media.DATA ) );

    Bitmap bitmap = BitmapFactory.decodeFile(filepath);
        /*
        * その他処理
        */
}

[`evernote` not found]
Pocket
[`yahoo` not found]