1

I made an application for Android and and I'm trying to make it work on every possible device.

For this, I created different layouts (small, normal, large, xlarge) with different densities (ldpi, mdpi, hdpi, xhdpi), but when I load the emulator with the range of layout-normal-xhdpi, the application doesn't start and make an exit exception (force close). For all other layouts, it works perfectly.

What should it be?

I'm using minSDK = "8", but I tried also with higher APIs and still not working. I also tested with the APIS below level 4 and it works perfectly (the problem of these APIs don't support all resolutions).

4

3 回答 3

1

You can provide alternative resources (drawables) and layouts (and languages for regional support). Please refer the android developer guide on supporting multiple screens, especially the section on how android selects the resources provided here.

Also an explanation is provided here, just scroll through the page to get a clear view on the subject.

于 2012-09-05T14:49:15.613 回答
0

just put these lines of code in your Manifest file :

<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:anyDensity="true" />
于 2012-09-05T14:42:00.843 回答
0

Here are some select lines from your log that tell you what's going on:

09-05 15:10:34.941: E/dalvikvm-heap(453): 9523200-byte external allocation too large for this process.

and:

09-05 15:10:35.112: E/AndroidRuntime(453): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Your bitmaps are extremely large (one in particular is ~9MB) and you are running out of memory. Use some smaller bitmaps.

于 2012-09-05T17:14:37.663 回答