Tuesday, September 14, 2010

[android-developers] Re: Cant seem to get resources to select with layouts for different densities

Just wanted to give a bit more info

I also have a layout.xml file in the default "layout" directory.

In my code the main activity uses this line:

setContentView(R.layout.main);


If I delete the layout.xml from the default layout directory I get a
force close on startup.

So does this line of code interfere with android's layout loading or
something , overriding it?

-niko

On Sep 14, 9:40 pm, niko20 <nikolatesl...@yahoo.com> wrote:
> Hi,
>
> I'm trying to understand the layout engine for different screen sizes
> and densities, to look into adding support for tablets in my apps.
>
> I was under the impression that you could also have different layouts
> based on screen density as well in android, and it would select the
> appropriate one.
>
> I have the following:
>
> a layout-normal-mdpi directory with a layout.xml file.
> a layout-normal-hdpi directory with a layout xml file with a different
> layout for high density screens.
>
> In my application manifest I have min SDK as 3,  target SDK as 5. I
> have a supports-screens element and declare the following:
>
> android:largeScreens="true" android:anyDensity="true"
>
> I'm compiling against Android 2.2 library.
>
> However, when I run an AVD that is in WVGA854 mode with a lcd.density
> of 240, android isn't using my hdpi layout, it still uses my mdpi
> layout. I don't know why and need help!
>
> Thanks!
>
> -niko

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate