In my application UI is changed based on mobile or tablet. So I am using 2 classes for mobile and tablet.
It is working fine in emulator. But in real tablet device it is not working it takes mobile device class.
MY code to detecting devices:
public boolean isTablet(Context context)
{
boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == 4);
boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
return (xlarge || large);
}
Whats wrong here with my code. I am getting mobile layouts on real device only.