Issue
The .getDrawable()
didn't Work with Me and I don't know why I tried many ways with no result like Android getDrawable() Deprecated / How To use Android getDrawable()
The app running with no errors but .getDrawable()
didn't Work. It's crossed out. I tried to use getDrawable(id, Theme theme)
. I replace Null
in Theme Place in didn't work too .
Solution
Try something like this:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
img.setImageDrawable(getResources().getDrawable(R.drawable.henedi, this.getTheme()));
} else {
img.setImageDrawable(getResources().getDrawable(R.drawable.henedi));
}
}
Answered By - ARP
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.