Answer the question
In order to leave comments, you need to log in
How to make different screen orientation for phone and tablet?
What to prescribe so that the screen orientation in the application on the phone is only portrait, and on the tablet both portrait and landscape (that is, on the tablet it depends on the rotation of the device, but not on the phone)? For now, I’m prescribing in the manifest so that the orientation is always portrait, but on a tablet it’s not always convenient, and on a phone, only portrait orientation is required.
Answer the question
In order to leave comments, you need to log in
Determine that you are dealing with a tablet, for example, like this:
public static boolean isTablet(Context context) {
return (context.getResources().getConfiguration().screenLayout
& Configuration.SCREENLAYOUT_SIZE_MASK)
>= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question