Differences between AppCompatActivity, ActionBarActivity, FragmentActivity, and Activity,

Source: Internet
Author: User

Differences between AppCompatActivity, ActionBarActivity, FragmentActivity, and Activity,
AppCompatActivity, ActionBarActivity, FragmentActivity, Activity

Android SDK introduces Fragment, ActionBar, and other features in API Level 11 (Android 3.0.x). Earlier sdks did not include these features. To enable devices of earlier versions to use these features, no error is reported, google provides the Android Support Library.
For example, to use Fragment on a device before Android 3.0, You need to import the android-support-v4.jar compatibility package and use FragmentActivity (inherited from Activity) to solve the problem of not using Fragment. For another example, to use ActionBar on a low-version device, you need to use the ActionBarActivity provided by the android-support-v7 compatibility package (inherited from FragmentActivity ).
Android SDK from API Level 21 (Android5.0) began to introduce Material Design style controls, in order to make earlier versions of devices can also use these features, Google updated the android-support-v7 compatibility package, appCompatActivity is used to replace ActionBarActivity. If a new android-support-v7 is used and an attempt is made to change ActionCompatActivity in the code to ActionBarActivity, it will prompt that it is out of date.

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.