[Android] New project inheritance activity does not inherit actionbaractivity

Source: Internet
Author: User

After the SDK update, in Eclipse new Android project, we often encounter such a thing: The new mainactivity no longer inherit activity but inherit actionbaractivity, due to some people's development habits, They do not like to use actionbaractivity but are accustomed to using activity.

Now let's talk about why you suddenly inherit actionbaractivity. Because the Actionbar in activity is only compatible with more than 3.0 versions, if you want to use it in a previous version, you should import the open source project--actionbarsherlock. And actionbaractivity This can solve this problem, can be compatible with the previous version of 3.0.

Solution:

A) When you create a new Android project, select the minimum version, select more than 4.0:


b) However, the minimum version of the project created is above 4.0, which is not what we want, but we just need to change the minimum compatible version to Androidmanifest.xml:


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

[Android] New project inheritance activity does not inherit actionbaractivity

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.