How do I check if my Android phone is horizontal or vertical?
android java orientation
if(getResources().getConfiguration().orientation == Configuration.
ORIENTATION_LANDSCAPE) {
layout = R.layout.main;
} } else if (getResources().getConfiguration().orientation == Configuration.
ORIENTATION_PORTRAIT) {
layout = R.layout.main;
}
You can do it like this.
© 2024 OneMinuteCode. All rights reserved.