Android Intent Personal Introduction

Source: Internet
Author: User

to open a new activity in Android, needless to say, Intent,intent is definitely used as one of the four components of Android, and it is understood that intent is used to communicate between (three different components), usually open One activity is to use

Intent.setclass (thisactivity.  this, targetactivity. class ) or do not use the above method, you can open the next activity through a configuration file first change the SetClass method to  intent.setaction ("com.accp.targetactivity"  ), and modify the configuration file <activity android:name= ". Targetactivity ">     <intent-filter>         <action android:name=" com.accp.targetactivity "/>         <category android:name= "Android.intent.category.DEFAULT"/>     </intent-filter></activity>

The Action,category property of intent is a normal string in which the action represents an abstract "action" to be done by the intent, while the category is used to add additional category information to the action. The Action property is typically used in conjunction with the Category property.

In the end, which activity will the program start? Depends on the configuration of the elements in the activity configuration. <activity.../> 's <Intent-filter.../> sub-elements are used to configure the Intent that the activity responds to.

Here we know that our own project will have a main activity, the main activity equivalent to the main function in C #, is the entire application of the storage, then how the main activity is started? Is it intent? With this question I found some information on the internet, of which Luo Shenyang's blog dedicated to the introduction of the "Android application launch process source code Analysis" This blog detailed how the application is launched, of course, I suspect that the main activity is actually initiated by intent.

This blog post also tells us, in order to understand some things, you can start from the source code, the answer is in the source code. This is a kind of problem-solving ideas and methods.

Android Intent Personal Introduction

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.