0

With the latest versions of android, mobile has been added as a lower bar of the tablets. That has made my application in these particular versions, may not appear properly, as it is designed to be seen without the bar.

So my question is: is there any way to make a layout version exclusive to these versions?

TZHX
  • 5,291
  • 15
  • 47
  • 56

2 Answers2

2

either do it programmatically like what "Simon" has written , or use the correct resource folder (using qualifiers) , for example:

res/layout-v11/ will be used for honeycomb and above .

res/layout/ will be for the rest.

for more info read here:

http://developer.android.com/guide/topics/resources/providing-resources.html

android developer
  • 114,585
  • 152
  • 739
  • 1,270
  • but, if i have layouts for all the screen resolution and densities..how i can do the same for a specific android version? I tried layout-v11-normal-hdpi but is incorrect format – user1649287 Sep 22 '12 at 15:11
  • look at table 2 on the link i've written. please read carefully . you need to use the exact same order as written there. btw, you can't handle resolutions , but you can handle other things using qualifiers , some similar to resolutions. – android developer Sep 22 '12 at 18:54
0

You can inflate any layout you like and set it as the Activity content.

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
     this.setContentView(R.layout.layout_pre_ics);
} else {
     this.setContentView(R.layout.layout_post_froyo);
}

[EDIT] Android developer's solution is better than mine.

Simon
  • 14,407
  • 8
  • 46
  • 61