Android getResources().getDrawable() deprecated API 22

You have some options to handle this deprecation the right (and future proof) way, depending on which kind of drawable you are loading: A) drawables with theme attributes You’ll obtain a styled Drawable as your Activity theme instructs. This is probably what you need. B) drawables without theme attributes You’ll get your unstyled drawable the old way. Please note: ResourcesCompat.getDrawable() is not deprecated! EXTRA) drawables with theme attributes from another theme