Activity of "Android Learning Summary": initial knowledge of activity and use

Source: Internet
Author: User

"The article in this blog is my study note summary, if there are errors please criticize correct, thank you!" Welcome to the group 285077071 Discussion

I. Purpose of activity (function)

Activity is one of the four components of the Android system (four components: Activity,service,broadcastreceiver,contentprovider) and one of the most commonly used components. Why is it one of the most used components? The main reason is that this component is a component that interacts directly with the user, which means that the component provides a lot of UI for the user to manipulate and respond accordingly. So many domestic developers are accustomed to translating it into "activities", I do not translate, because the concept of "activities" can not highlight the nature of activity, and will make people produce ambiguity.

Ii. simple use of activity

Activity is mainly used in the following steps:

1, inherit the parent activity: In the future we will use the four components in the way of inheritance through the use of

2. Register in the Androidmainfest.xml file: Register within the manifest file when using four components

3. Rewrite the OnCreate (Bundle savedinstancestate) method: Set the UI layout file to be displayed within the method

The next run will see our first Hello World example, which is simple.

650) this.width=650; "Src=" http://img.blog.csdn.net/20151014154742692?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/southeast "style= "Border:none;"/>


650) this.width=650; "Src=" http://img.blog.csdn.net/20151014154759710?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/southeast "style= "Border:none;"/>

650) this.width=650; "Src=" http://img.blog.csdn.net/20151014155312335?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/southeast "style= "Border:none;"/>


This article is from the "Fukung-Kunming Mobile Internet" blog, please be sure to keep this source http://kinbos.blog.51cto.com/2092114/1702868

Activity of "Android Learning Summary": initial knowledge of activity and use

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.