The blog for Android-idea posted on the internet is http://blog.csdn.net/cjjky/article/details/6337172.
In practical applicationProgramDuring development, we sometimes need to set the activity to full screen display. Generally, we can set the full screen display effect in two ways. FirstCodeCan be set, second, set full screen through the manifest configuration file.
1. Set it in the Code (as follows)
Public VoidOncreate (bundle savedinstancestate ){Super. Oncreate (savedinstancestate );//Set no titleRequestwindowfeature (window. feature_no_title );//Set full screenGetwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen); setcontentview (R. layout. Main );}
However, you must note that if you set it in the Code, the two sections of code with no title and full screen should be placed in front of setcontentview (R. layout. Main. Otherwise, an error is reported.
Second, set it in the manifest configuration file.
<? XML version = "1.0" encoding = "UTF-8" ?> < Manifest Xmlns: Android = "Http://schemas.android.com/apk/res/android" Package = "Com. andyidea" Android: versioncode = "1" Android: versionname = "1.0" > < Uses-SDK Android: minsdkversion = "8" /> < Application Android: icon = "@ Drawable/icon" Android: Label = "@ String/app_name" > < Activity Android: Name = ". Login. loginactivity" Android: Theme = "@ Android: style/Android. notitlebar. fullscreen" Android: Label = "@ String/app_name" > < Intent-Filter > < Action Android: Name = "Android. Intent. Action. Main" /> < Category Android: Name = "Android. Intent. Category. launcher" /> </ Intent-Filter > </ Activity > </ Application > </ Manifest >
Add the property Android: theme = "@ Android: style/theme. notitlebar. fullscreen" to the corresponding activity node to set the full screen display of an activity. If it is set to Android: theme = "@ Android: style/theme. notitlebar", it is only set to the Untitled state.
Note: I added this attribute to my project according to the second method, but the compiler will prompt: Error: no resource found that matches the given name (at 'Theme 'with value' @ android. style/android. notitlebar. fullscreen '). in this case, you need to clear the project and everything will be OK.