在安卓xml文件中更改横竖屏切换
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation"
>
<!--
android:screenOrientation="portrait" 竖屏
android:configChanges="keyboardHidden|orientation"
这两句为设置横屏和竖屏,在屏幕切换的时候默认为重新走OnCreate方法
当设置了configChange之后就不会再重新走onCreate方法
-->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
这代码中更改横竖屏切换
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
在xml文件中添加全屏显示
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<activity
在代码中添加全屏显示
//全屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//去标题
requestWindowFeature(Window.FEATURE_NO_TITLE);
《Android版本更新、热更新》系列课程视频
版本更新6.0,7.0统统搞定!!
热修复不在麻烦,再也不用担心上线后出bug!!
http://edu.youkuaiyun.com/course/detail/6523
http://edu.youkuaiyun.com/course/play/6523/131198
《Kotlin语法基础到实战开发》系列课程视频
http://edu.youkuaiyun.com/course/detail/6409?locationNum=7&fps=1&ref=srch&loc=1