android中全屏的方法

1.直接代码编写

@Override
     protected void onCreate(Bundle savedInstanceState)
     {
         requestWindowFeature(Window.FEATURE_NO_TITLE);
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
         super.onCreate(savedInstanceState);
         setContentView(R.layout.welcome);
     }

2.配置AndroidManifest.xml

<application
          android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
          <activity
              android:name=".Welcome"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 8         >
              <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
         <activity
             android:name=".AboutApp"
android:label="@string/aboutapp_title"
android:theme="@android:style/Theme.Dialog"
/>
    </application>

相关推荐