Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Android looking for QVGA resources in the wrong order mdpi > hdpi > ldpi?

I'm trying to do some testing with a QVGA emulator and I find that it looks for an image resource in the mentioned order.

drawable-mdpi 1st
drawable-hdpi 2nd
drawable-ldpi 3rd
(it does get found only after I change the name of the image in the other two dirs for testing)

I would expect it to be ldpi first.

When running other emulators (HVGA and WVGA) they use their appropriate drawable dirs... it's only QVGA. The only code that I see could affect this is here (based on the docs)

I have tested this with a 2.0 emulator and a 1.6, I get the same result.

Any ideas? Thank you very much.

like image 550
The Way Avatar asked Nov 06 '22 16:11

The Way


2 Answers

Check the hw.lcd.density setting in the config.ini for you QVGA AVD. If this is set incorrectly then the emulator might not be running as a low density device. It should be 120.

You can also check using the Details button in the Android SDK and AVD Manager GUI which you can launch from Eclipse or by entering android at a command prompt:

alt text

like image 64
Dave Webb Avatar answered Nov 12 '22 21:11

Dave Webb


It appears that I have to enter the density manually.

If I just select QVGA as a Skin from the "Built-in" drop down list it puts 120 as the value for the Abstracted LCD density, but it doesnt seem to work...

So I delete that property and add it back, then change the value to 120. Thank you much Dave for your direction.

like image 32
The Way Avatar answered Nov 12 '22 21:11

The Way