In mobile application development, there may be times when you want certain screens within your app to always show in landscape or in portrait mode. Android makes this easy to do within your Activity class:
import android.content.pm.ActivityInfo;
...
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
You can also set this in the manifest:
Like this:
Like Loading...
Published by Karim Varela
I'm an entrepreneur and blockchain enthusiast, currently cofounder and CTO at Roam, a travel company at the intersection of blockchain. Previously, I built a mobile banking platform as the Vice President of Engineering and managing partner at Beam Financial. I was also part of the engineering teams which built Coffee Meets Bagel, Tinder, and Fandango.
In my spare time, I enjoy salsa dancing, Brazilian jui jitsu, and traveling the world.
View all posts by Karim Varela
You must log in to post a comment.