aromero
aromero

Reputation: 25761

Error resolving drawable resources in Android API Level 3

I'm developing an application that uses tabs and should be compatible with Android 1.5 (API Level 3).

Please see Tab icons compatibility between API level 3 and >=5. Basically I have two sets of tab icons as google recommends.

When running in a device/emulator >= Level 5 everything works correctly, tab icons are displayed ok using the -v5 resources. In a device Level 4 everything also works ok, tab icons are also ok.

However, when using a device level 3 the app crashes when trying to resolve a drawable resource. The stack says something like this:

Caused by: java.io.FileNotFoundException: res/drawable/splash_background.xml
       at android.content.res.AssetManager.openXmlAssetNative(Native Method)
       at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:471)
       at android.content.res.Resources.loadXmlResourceParser(Resources.java:1825)

Note that res/drawable/splash_background.xml exists. This is one example, it throws the same error when trying to fetch any drawable resource.

Any clues on this?

Upvotes: 0

Views: 518

Answers (1)

bigstones
bigstones

Reputation: 15267

The -ldpi, -hdpi and -mdpi qualifiers were added in API 4, so they don't work.

See Providing screen resource compatibility for Android 1.5.

Upvotes: 4

Related Questions