Android Studio New project inherits appcompatactivity settings hide title bar also flash back

Source: Internet
Author: User

Originally to do cocos2d-x development, but in the company after some Android SDK also slowly began to contact Android. It is said that Google started not supporting Eclipse ADT, do not know if it is true. Running this news I tried the next, this software. Cocos Studio is very CPU-intensive i5 means a bit too much, and memory is still there. The editing function is also very powerful.

A new project has been created, and it is found that the new normal Android project is not a succession of activity but a layer more. It inherits Appcompatactivity and Appcompatactivity inherits the activity according to the principle of inheritance. They should be no different. But when I go to set hidden under the title bar, I find that there is a flashback phenomenon. Asked a lot of people, the answer is basically not inherit appcompatactivity directly inherit activity to do so. In fact, it is possible to do so. I was wondering if there was a way not to change it. I've been trying to figure out

The original code was used

This.requestwindowfeature (Window.feature_no_title);

This is going to be a flashback in this case. This is caused by the use of the actionbaractivity under the APPCOMPAT_V7 package .

At the beginning we can also see this line of code

import android.support.v7.app.AppCompatActivity;

So we're going to use

Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
Getsupportactionbar (). Hide ();

To set the title bar.

Android Studio New project inherits appcompatactivity settings hide title bar also flash back

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.