I am trying to figure out how to change this setting programmatically. Can anyone point out an API or suggest something?
Images show where this option is in Android:
Mark this link
http://developer.android.com/reference/android/provider/Settings.System.html#ACCELEROMETER_ROTATION
And here is the code for you
android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settings.System.ACCELEROMETER_ROTATION,1);
And this permission is required in the manifest
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
If what you are trying to do is lock your application in a specific screen orientation, you can use the android:screenOrientation in the activity manifest.
android:screenOrientation
See here .
Source: https://habr.com/ru/post/1440545/More articles:Testing model that acts_as_nested_set with RSpec - ruby-on-railsWPF DependencyProperty Chain Notification - wpfNodeJS reads and parses every line of stdout - javascriptthat the installation will be $ _REQUEST empty on the PHP server? - ajaxConfirmation error in - [UITextFieldLabel setTextColor:] - uitextfieldVisual Studio 2012 - code coverage - how to do it right? - c #regex in Notepad ++ to remove blank lines - regexhtaccess AddHandler *** x-httpd-php5x *** and *** application / x-httpd-php5x *** - phpFilter a text file to get unique entries based on the value in column 3 - sortingHow to customize NSTableView row drag and drop? - nstableviewAll Articles