Skip to content Skip to sidebar Skip to footer

Android Getdrawable() Deprecated / How To Use Android Getdrawable()

Can anyone tell me the right way of using getDrawable() , I recall last time I used it was just fine with one parameter, but now I am getting this method is deprecated error, anyon

Solution 1:

Since API 22 you should call ContextCompat.getDrawable(context, R.drawable.***) instead of getResources().getDrawable(R.drawable.***).

You can see the documentation of ContextCompat from the support library for more details.

Post a Comment for "Android Getdrawable() Deprecated / How To Use Android Getdrawable()"