requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);AndroidMainfest.xml文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
android:versionCode="1"
android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/transparent"
android:screenOrientation="sensor"
android:configChanges="orientation"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SystemInfo"
android:label="@string/app_name"
android:theme="@style/transparent"
android:screenOrientation="sensor"
android:configChanges="orientation"
>
</activity>
</application>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
</manifest>之前好好的,没什么问题,今天就不行了,其他应用里设置都可以全屏的,我就郁闷了
还有一个问题,就是我必须设置android:screenOrientation="sensor"才会屏幕翻转,可是应用应该是会自用翻转屏幕的啊?
这两个问题,请大家看看是怎么回事
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);AndroidMainfest.xml文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
android:versionCode="1"
android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/transparent"
android:screenOrientation="sensor"
android:configChanges="orientation"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SystemInfo"
android:label="@string/app_name"
android:theme="@style/transparent"
android:screenOrientation="sensor"
android:configChanges="orientation"
>
</activity>
</application>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
</manifest>之前好好的,没什么问题,今天就不行了,其他应用里设置都可以全屏的,我就郁闷了
还有一个问题,就是我必须设置android:screenOrientation="sensor"才会屏幕翻转,可是应用应该是会自用翻转屏幕的啊?
这两个问题,请大家看看是怎么回事
<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);这段代码要放到setContentView的前面才会生效
我也遇到这个蛋疼的问题,想配置后,也可以动态全屏,可是实现不到,有知道的同学可以帮我回答下?