Linghui
Linghui

Reputation: 151

What's preventing Android from finding a resource file in drawable?

I'm working on a bug of my Android application and it only occurs on a Galaxy Nexus with Android version 4.2.2, but works fine on my Nexus 5 with 4.4.2.

Basically it's not able to find a png file on this device.

The png file is only located in res/drawable and here is the structure of my res folder:

res/drawable
res/drawable-de
res/drawable-fr
res/drawable-it
res/drawable-hdpi
res/drawable-ldpi
res/drawable-mdpi
res/drawable-xhdpi
res/drawable-xxhdpi

What could be preventing Android to fallback to the drawable folder in this case?

Upvotes: 0

Views: 38

Answers (2)

alijandro
alijandro

Reputation: 12177

What is the configuration of your device when the drawable resource couldn't be found? When the device language is German, it might happen that one of the resource directory, e.g res/drawable-de has taken precedence of the drawable directory.

Take a look at here how android find the best matching resources.

Upvotes: 0

Tim Mutton
Tim Mutton

Reputation: 766

Without knowing anything about the image its hard to say, but the image may be too large. Alternatively, unless there's a compelling reason not to, you should probably put it in a *dpi folder anyway

Upvotes: 1

Related Questions