Issue
I went upto here to add an image to my android app but there is an error line:
String pathName = "chemistry\2013_03_26\chemistry1.pdf";//Error line
Resources res = getResources();
Bitmap bitmap = BitmapFactory.decodeFile(pathName);
BitmapDrawable bd = new BitmapDrawable(res, bitmap);
View view = findViewById(R.id.container);
view.setBackgroundDrawable(bd);
Solution
I think you should use absolute path with getFilesDir()
or getExternalFileDir()
.
You can find more information at clickHere
Answered By - trojantale
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.