android - Is there a way to force different orientations for different devices? -
android - Is there a way to force different orientations for different devices? -
i want app displayed landscape on tablets, should rotate ok on mobiles. there way (besides of having 2 different apks)?
use method check whether device tablet, force orientation if it's true.
// http://stackoverflow.com/questions/5832368/tablet-or-phone-android public boolean istablet(context context) { boolean xlarge = ((context.getresources().getconfiguration().screenlayout & configuration.screenlayout_size_mask) == 4); boolean big = ((context.getresources().getconfiguration().screenlayout & configuration.screenlayout_size_mask) == configuration.screenlayout_size_large); homecoming (xlarge || large); } // ... // activity not wish rotate on tablets: if (istablet(this)) setrequestedorientation(activityinfo.screen_orientation_landscape); android device-orientation
Comments
Post a Comment