HDPI and MDPI Problem
All these days i used to test my application on my HTC Legend (2.1 OS) only, and i had all my images resources in drawable-hdpi folder.. and everything worked fine
and today i wanted to test my Application on Android 1.5, so i recreated all the images with lower resolution and kept it under drawable-mdpi folder, so now i have High resolution images in drawable-hdpi folder and lower resolution images in draw开发者_如何学编程able-mdpi folder..
Everything looked great on both the HTC Legend and Emulator(with Android 1.5)
Later i found out that the images in drawable-mdpi are shown in my HTC Legend too and not the images in drawable-hdpi
in my manifest file i have also included
<uses-sdk android:minSdkVersion="3" />
<supports-screens android:anyDensity="true" />
Can anyone help me with this, I want to know as to why the images in drawable-hdpi are not used?
Try removing
<supports-screens android:anyDensity="true" />
UPD:
Just noticed that Legend is MDPI device (Resolution: 320 X 480 HVGA). So the question is incorrect, your application behaves as it is expected to behave.
Look at the section https://developer.android.com/guide/practices/screens_support.html#range to become educated on android device sizes and densities.
You can try adding
android:targetSdkVersion="4"
and remove the anyDensity
tag.
I notice that the images are not always updated 'live'. Uninstalling the app using ADB is not successful in updating the images (in folders ldpi, mdpi, hdpi, xdpi).
Sometimes, a phone restart is needed before the images are refreshed. Seems like there is a cache in the phone to store these images, even after uninstalling.
精彩评论