http://blog.csdn.net/netpirate/article/details/4216306
修改Android项目的AndroidManifest.xml设置:
1、控制屏幕方向(横屏/竖屏),默认自动切换,修改Activity的配置:
//竖屏
android:screenOrientation="portrait"
//横屏
android:screenOrientation="landscape"
2、不显示窗口标题(window title),最大化窗口,默认显示,修改Activity的配置:
android:theme="@style/Theme"
//res/values/styles.xml
<style name="Theme" parent="android:Theme">
<item name="android:windowBackground">@null</item>
<item name="android:windowNoTitle">true</item>
</style>
3、不显示状态条(state bar),完全全屏(fullscreen),默认显示,修改程序:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
4、获取屏幕的方向:横屏/竖屏。。。
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
{
Log.i("info", "landscape");
}
else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{
Log.i("info", "portrait");
}