0

If I am using an Android device which prefers drawables from, say drawable-hdpi, can I still use a drawable from, for example the drawable-xxhdpi folder in my program? (Note: I have complete sets of icons for all resolutions).

(I would like to use extra high-res icons for some parts of my app)...

JohnyTex
  • 3,323
  • 5
  • 29
  • 52
  • For best practice you need to put the different `density bitmap/image` to there specified folder instead of getting it from different drawable folder. – Rod_Algonquin Sep 02 '15 at 07:46

1 Answers1

1

You can get a different drawable of another density using this method:

Drawable drawable = getResources().getDrawableForDensity(id, DisplayMetrics.DENSITY_XHIGH, theme);

You can check the answer in the next post: Get drawable for different screen density at runtime and in the Developer Guide

Community
  • 1
  • 1
Víctor Martín
  • 3,352
  • 7
  • 48
  • 94