android two settings activity of full-screen mode

The first is disposed in our code, the following two lines of code:

But these two codes must be declared before setContentView (R.layout.main) , must pay attention to this period, it may not be successful. Much gossip that the code is as follows:

   public  void the onCreate (the Bundle savedInstanceState) { 
        super.onCreate (savedInstanceState); // no title, the title does not appear in the activity is 
        requestWindowFeature (Window.FEATURE_NO_TITLE); before // activity generated, full-screen operation has 
        getWindow (). setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 
        the setContentView (R.layout.main); 
    }
        
        
The second is declared in our mainfest.xml file, as life can be, mainly declared as a full-screen style:
mainfest文件配置代码<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.guchan"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />
    
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            Android: name = " .QQblogActivity " 
            <- - Main configuration here is the style of this activity can be!> 
            Android: Theme = " @android: style / Theme.NoTitleBar.Fullscreen "> 
            <the Intent-filter> 
                <Action Android: name = " android.intent.action.MAIN " /> 

                <category Android: name = " android.intent.category.LAUNCHER " /> 
            </ Intent-filter> 
        </ Activity> 
    </ file application> 

</ the manifest>

Well, this is the way for both full-screen configuration, the above can refer to learn.

Reproduced in: https: //www.cnblogs.com/alterhu/archive/2011/10/30/2229179.html

Guess you like

Origin blog.csdn.net/weixin_33763244/article/details/94121603