Can we perform within application level?
No! you can not set screenOrientation for <application
tag. You have to provide this to each Activity.
If you ask me common way to do this-
Make BaseActivity.java
and set orientation in it's orientation. Now extend all your Activities from BaseActivity.java
.
Either Programatically
public class BaseActivity extends AppCompactActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
}
Or in manifest.xml
<activity
android:name=".BaseActivity"
android:screenOrientation="landscape"/>