Thursday, May 26, 2016

[Android][Resolved] getdrawable(int) is deprecated


Since the method getDrawable(int id) is deprecated in API level 22. You should use getDrawable(int id, Resources.Theme theme) instead.

deprecated :
getDrawable(int id)

method to replace :
getDrawable(int id, Resources.Theme theme)
Resources.Theme: The theme used to style the drawable attributes, it obtain a drawable resource with theme attributes and can be null. ,

Reference:

http://my.oschina.net/1pei/blog/478984
https://developer.android.com/reference/android/content/res/Resources.html
https://plus.google.com/+AlanViverette/posts/YHy5drbz3oN

No comments :

Post a Comment