How to remove the title bar and misunderstanding During Android app startup?

Source: Internet
Author: User

Thank you !!!

Reprinted Please note:Http://blog.csdn.net/richway2010/archive/2011/06/29/6574987.aspx

[Bloggers: Dear bloggers, netizens, and everyone else! Welcome to this blog.You are welcome to have more exchanges, give more comments, learn from each other, and make mutual progress. Our slogan is: study hard and make progress every day .]

Hello everyone, let's share a question that beginners may think is strange. Most beginners have such problems, but they do not know how to solve them. I will throw this question and hope it will help you.

Problem description: when the application is started, a black screen will pop up and then enter the mainProgram. When the first black screen is displayed, you will find a title bar information, but you cannot find the page? Very confused, as shown in:

 

The following page is displayed:

 

As shown in, all contain the title bar. The page with the title bar is normal, that is, the page of our main program. Why is the title bar instead of full screen displayed on the previous page? Which page is this?

There are several methods for full screen processing of the program. Let's modify and configure the information in androidmanifest. XML as follows:

<Application Android: icon = "@ drawable/icon"> <br/> <activity Android: Name = ". loadingsystem "Android: Label =" @ string/app_name "Android: theme =" @ Android: style/theme. notitlebar "> <br/> <intent-filter> <br/> <action Android: Name =" android. intent. action. main "/> <br/> <category Android: Name =" android. intent. category. launcher "/> <br/> </intent-filter> <br/> </activity>

Added a property: Android: theme = "@ Android: style/theme. notitlebar", which means that the title bar is not required.

Save and restart. Let's run it to see the effect:

 

The title bar of the first screen does not exist. This page is normal.

 

The title bar of this page also does not exist. The original source is here. Solved.

 

Fault description:

There is also a way to modify the above problems in the program,CodeAs follows:

Public void oncreate (bundle savedinstancestate) {<br/> super. oncreate (savedinstancestate); <br/> // No title <br/> requestwindowfeature (window. feature_no_title); <br/> // full screen <br/> getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, <br/> windowmanager. layoutparams. flag_fullscreen); </P> <p> setcontentview (R. layout. main); <br/>}

This can also remove the title bar. However, the title bar of the black screen page cannot be removed. It can only work on the page title bar of the current activity. Not global.

 

OK. I hope it will help you. Support me a lot. Top me.

 

 

 

Related Article

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.