I'm new to Android, sorry if my question doesn't make a lot of sense, but I've searched a lot and could't make this clear yet.
I have an Item object, that gets build with data pulled from an sqlite db. One of this Item's fields is a Bitmap (stored as a Uri in the DB) that should be created from the Uri in the Item's constructor.
I'm getting java.io.FileNotFoundException: No package found for authority: android.resource://com.my.package/drawable/theImage
when I try to do the following in the constructor:
try {
actualPic = MediaStore.Images.Media.getBitmap(app.getContentResolver(), theImageUri);
} catch (IOException e) {
e.printStackTrace();
}
IMPORTANT: MainActivity, which is the class instantiating the Item object, passes a reference to itself to the Item's constructor called app, which I use to call getContentResolver method.
I read that I need to make a class that extends ContentProvider and declare it in the manifest, but it seems like a a lot to do to just get that Bitmap. Am I missing something? Is there a simpler way of getting that Bitmap retrieved or I need to create that new class?
Thanks in advance.