I am developing an android application which needs to have different layouts for tablet in landscape and other screen sizes. I've created different layouts in different folders like it is suggested in android tutorial (http://developer.android.com/training/multiscreen/screensizes.html).
So I have layout-xlarge, layout-xlarge-land and so on and layout preview seems to recognize those layouts for different devices however when I launch my application, the layouts are no longer recognized as per device. Following code always returns normal size layout:
int screenLayout = context.getResources().getConfiguration().screenLayout;
screenLayout &= Configuration.SCREENLAYOUT_SIZE_MASK;
switch (screenLayout) {
case Configuration.SCREENLAYOUT_SIZE_XLARGE:
initXLargeLayout();
return;
default:
initViePagerDefaultLayout();
return;
}
I could not find anyone with similar problem. Should I add something to manifest file?