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

How to add an image to the “drawable” folder in Android Studio?

For Android Studio 1.5: Right click on res -> new -> Image Asset On Asset type choose Action Bar and Tab Icons Choose the image path Give your image a name in Resource name Next->Finish Update for Android Studio 2.2: Right click on res -> new -> Image Asset On Icon Type choose Action Bar and Tab Icons On Asset type choose Image On Path choose your image path Next->Finish The … Read more

Mipmaps vs. drawable folders

The mipmap folders are for placing your app/launcher icons (which are shown on the homescreen) in only. Any other drawable assets you use should be placed in the relevant drawable folders as before. According to this Google blogpost: It’s best practice to place your app icons in mipmap- folders (not the drawable- folders) because they are used at … Read more