Skip to content Skip to sidebar Skip to footer

Android Studio Doesn't Recognize Images In Hdpi Folder

I saved some images directly to the drawable folder. These, Android Studio recognizes normally. But the images saved in the mhdpi, hdpi, xhdpi, xxhdpi and xxxhdpi folders the code

Solution 1:

Try making new drawable folders for putting images after right clicking res folder and name folders like this

drawable-hdpi

drawable-mdpi

drawable-xhdpi

drawable-xxhdpi

drawable-xxxhdpi

Drag and drop image with same name according to their dimensions. The android takes drawable folder as one entity, picks up the best suited image and shows it on different resolution phones.

enter image description here

Solution 2:

The whole point of the drawable folders is that Android can decide which density it should take depending on the screen resolution.

A low resolution device will e.g. the drawable from the drawable-ldpi folder and a very high resolution device will take the drawable from the drawable-xxxhdpi folder.

In your code you always reference the drawable as

R.drawable.yourdrawablename

Post a Comment for "Android Studio Doesn't Recognize Images In Hdpi Folder"