Search code examples
androidcompatibility

Why layout-large-v11 resource does not apply on Android 4.0 WVGA800 phone


I am testing with Google's iosched2011 app, and tested with a 4.0.3 simulator.

I am wondering why layout-large-v11 resource does not apply on Android 4.0 WVGA800 phone. It looks like 800*480 is taken as a large screen, and android 4.0's API level is big than 11. So it should apply the resource on that folder in this phone, but it turns out not.


Solution

  • Check in your app how Android sets configuration:

    in activity onCreate add this:

    Configuration cfg = getApplication().getResources().getConfiguration();
    int sz = cfg.screenLayout&cfg.SCREENLAYOUT_SIZE_MASK;
    System.out.println("size: "+sz);
    

    in logcat you'll see number, one of these.

    On Samsung Galaxy Nexus with 4,65' screen I get 2 = SCREENLAYOUT_SIZE_NORMAL. So you can expect same.

    From Docs:

    A set of four generalized sizes: small, normal, large, and xlarge

    Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.