Android - 用程序改变屏幕垂直或水平(旋屏)

android.view.IWindowManager windowService = android.view.IWindowManager.Stub.asInterface(android.os.ServiceManager.getService(”window”));

try
{
if (windowService.getOrientation() == 0)    //Orientation vertical
{
windowService.setOrientation(1);  //Orientation horizontal
Log.i(”info”, “orientation 1 “+windowService.getOrientation());
}
else
{
Log.i(”info”, “orientation 0 “+windowService.getOrientation());
}
}
catch (DeadObjectException e)
{
e.printStackTrace();
}

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭