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"才会屏幕翻转,可是应用应该是会自用翻转屏幕的啊?
这两个问题,请大家看看是怎么回事

解决方案 »

  1.   

    试一下
    <application android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
      

  2.   

    这个代码要放在setContentView(R.layout.main)前面· 
      

  3.   

    或者在在manifest配置文件中设置android:theme="@android:style/android.NoTitleBar.Fullscreen"  
      

  4.   

    requestWindowFeature(Window.FEATURE_NO_TITLE);
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);这段代码要放到setContentView的前面才会生效
      

  5.   

    回楼上各位,我知道设置在setContentView前面,不设置在setContentView会出异常的,莫名其妙的是还是不好使
      

  6.   

    我勒个去 ,我也是遇到了这个问题  ,,估计是自己继承了一个Layout的原因楼主解决了吗?
      

  7.   

    其实这个问题很简单,只要去除AndroidMainfest.xml文件activity中的 android:theme="@style/transparent"属性,其他的不用改,就OK了
    我也遇到这个蛋疼的问题,想配置后,也可以动态全屏,可是实现不到,有知道的同学可以帮我回答下?