I've an application running successfully, the application runs only in portrait mode only, if i'm going to change this to landscape, it's also possible to change. But, it won't never come to portrait mode. How can i u开发者_Go百科se these (portrait & landscape) in same time? Is it possible? Thanks in advance.
use this code where you have to change portrait to landscape,
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
use this to change landscape to portrait.
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
if you want the app to run in land and port you don't need to place anything just take out the code line that is forcing it. Hope it helps
精彩评论