Opening a resource outside an activity in Android -
I am trying to open a resource by passing the result of context.getResources (). GetString (R.drawable.myimage) for any other category that is not the activity Context.getResources (). GetString (R.drawable.myimage) Returns / Drawable-mdpi / myimage.png However, when I try and open this file, it throws FileNotFoundException.
What's the proper way to open a resource outside an activity?
Can you post code where you try to open the file.
res / drawable-mdpi / myimage.png is the relative path, not an integer I think that you are not opening the correct path using the relative and absolute path.
Comments
Post a Comment