There is an application, and I would like to add the ability to change the orientation, those loading another layout only by 10 ". As an option only by 10" +.
Is it possible to do something like that? If so, please tell me which method to use.
There is an application, and I would like to add the ability to change the orientation, those loading another layout only by 10 ". As an option only by 10" +.
Is it possible to do something like that? If so, please tell me which method to use.
For a 10 "+ 10-inch tablet use the modifier for resources -xlarge or -sw800 API 13+
You need to prohibit the change of orientation for all devices except:
Create a folder with resources similar to the values for the example values-sw800 and values-xlarge, put the boolean flag there:
 <bool name="orientation_portrait">false</bool> When starting, insert a piece of code example:
 if(getResources().getBoolean(R.bool.orientation_portrait)) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); It turns out that only at the start, the device 10 "+ it will be possible to change the orientation to land, otherwise only portrait. Do not forget only in default values, add a resource too: only true.
layout-sw800 with predefined styles and when the orientation changes, it will be loaded exactly? - St. IvanSource: https://ru.stackoverflow.com/questions/546888/
All Articles