Get the URI of an image stored in drawable

You should use ContentResolver to open resource URIs:

Uri uri = Uri.parse("android.resource://your.package.here/drawable/image_name");
InputStream stream = getContentResolver().openInputStream(uri);

Also you can open file and content URIs using this method.

Leave a Comment