The Android simulator removes header headers

Source: Internet
Author: User

Open a. androidmanifest.xml file, locate the application node

Android:allowbackup= "true" android:icon= "@drawable/ic_launcher" android:label= "@string/app_name" Android:theme= "@ Style/apptheme ">

Change to the following code, you can go to the head title bar

Android:allowbackup= "true"  android:icon= "@drawable/ic_launcher"  android:label= "@string/app_name"  

Change to the following code, you can go to the head title bar and full screen display

Android:allowbackup= "true"  android:icon= "@drawable/ic_launcher"  android:label= "@string/app_name"  Android:theme= "@android: Style/theme.notitlebar.fullscreen" >

Methods that are resolved in Java code:

 public  class  mainactivity extends   activity{@Override  protected< /span> void   OnCreate (Bundle savedinstancestate { super  .oncreate (Savedinstancestate)        ;         //  This part must be called before Setcontentview ()          //  remove the window title   //  load layout    

The Java code shown in full screen is as follows:

ImportAndroid.os.Bundle;ImportAndroid.view.Window;ImportAndroid.view.WindowManager;Importandroid.app.Activity; Public classMainactivityextendsactivity{@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); //This section must be called before Setcontentview ()//Remove Window Captionrequestwindowfeature (Window.feature_no_title); //Hide the status bar and display it in full screen//The first type:GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_FULLSCREEN); //The second type: (Two ways effect)//GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,//WindowManager.LayoutParams.FLAG_FULLSCREEN); //Loading LayoutsSetcontentview (R.layout.activity_main); }}

The Android simulator removes header headers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.