data.If the service is intended to use a client-server interface, by passing it on Intent bindService() , you can bind to the service from other components. For more information, please refer to the service guide.
Delivery Broadcast :Broadcasts are messages that can be received by any application. Various broadcasts are delivered for system events, such as when the system starts or when the device starts charging. Intentyou can pass the sendBroadca
component's componentname for a message delivery within an application, such as starting another activity or a services.The componentname of the target component is established through intent's setcomponent and SetClass.
2. Implicit mode. The componentname is empty to invoke components in other applications. You need to include enough information so that the system can use intent filter to filter action, data, or category in all components to match
Intent in Android is a very important class, and if you're not particularly knowledgeable about intent, see "How to use intent in Android." If you are not particularly familiar with intent filter, see "Detailed
, Android will not pass the implicit intent to the target component. Next we explain the specific rules of these three aspects of inspection.1. Action test
A (1) If the (2) Conversely, if the action type is not set in the intent request, the intent request will smoothly pass 2. Category test
We already know that an activity calls another activity by using an intent object. To allow other activities to respond, you also need to configure the
[Java]View plaincopy
1. Create a project and create a class: mybrowseractivity. java. Create an XML file brwoser. XML in RES/layout.
2. androidmanifest. xml
[Java]View plaincopy
Package = "com. Manoel. intents"
Android: versioncode = "1"
. Activity's Intent Filter)If the action is specified by intent, the action must be included in the Intentfilter action list of the target component, otherwise it cannot be matched;If the intent does not provide a type, the system will get the data type from it. As with action, the data type list of the target component must contain the
If multiple activity has the same intent action, what happens when starting with the same action? How do I specify an activity to start? In cases where multiple activity has the same intent action, if you want to start a specified activity, the Add StartActivity (New Intent ("Com.w.learnintent.intent.action.myaty", Uri.parse ("app://myaty1"));second, how toinitia
(Android review) explicit and implicit intent Activation
I. Basic knowledge points
1,
Label attribute: the title of an Acivity.
2. Do not introduce the R file into an error.
3. intent. setClass (this, Main2Activity. class );
First parameter: Context
Second parameter: the bytecode file of the component to be activated
4. Explicit activation (explic
Intent.It is mainly used for interaction and communication between various components of an application, and also for interaction between activities/services within the application.For example, you can call an external program in an application, call the call directly, or switch between activities in the application.It can be said that it is the essence of loose coupling of the Android architecture.Intent describes the actions, actions involving data,
Intent connecting two different components during program run (acvivity)For example, when we click on a contact on the phone to view its information, we need to tell Android via intent, I want to do a "view" actionTo achieve the jump from interface A to interface BDeclaration method: Intent
Android does not need to parse explicit intent because the target component is clear. Android needs to parse implicit intent, map intent to the activity, intentreceiver, or service that can process the intent.The intent parsing me
= getwordfileintent ("/system/etc/help.doc"); Intent it = getexcelfileintent ("/mnt/sdcard/book1.xls")//intent it = getpptfileintent ("/mnt/sdcard/download/
Android_ppt.ppt ");//intent it = getvideofileintent ("/mnt/sdcard/ice.avi ") under the download directory of the//SD card;
Intent it = getaudiofileintent ("/mnt/s
This example describes the intent usage in Android development. Share to everyone for your reference, specific as follows:
Android phone software development, intent as a mobile phone software development is very important objects need to arouse our attention, in fact, intent
Compare Android Intent with IOS StoryBoard Segue-Intent If you can add a Prepareforsegue callback.The beautiful Life of the Sun Vulcan (http://blog.csdn.net/opengl_es)This article follows "Attribution-non-commercial use-consistent" authoring public agreementReprint Please keep this sentence: Sun Vulcan's Beautiful Life-this blog focuses on Agile development and m
The intent object is described in the official Android API: It is a passive data structure holding an abstract description of a operation to be performed.The introduction of the Intent mechanism is a message mechanism for implementing communication between components of an Android application,
In Android, an activity represents an interface that uses intent to link different activitiesCreate a new project,Create a new class class that is named New1activity.Add a key to the XMLAdd the following code in the Mainactivity.java650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/59/BD/wKiom1TdmzihzfvGAAD_8DcUU_c564.jpg "title=" 2.png " alt= "Wkiom1tdmzihzfvgaad_8dcuu_c564.jpg"/>In Androidmanifes
(Note: PackageManager can obtain
Application package information) to find the component that can process the Intent. In this parsing process, Android uses the Intent action, type, and category attributes to determine the attributes. The judgment method is as follows:
1.1 If Intent indicates that action is set, the
the information. For a direct intent, Android does not need to parse it, because the target component is clear, and Android needs to parse the indirect intent, the intent is mapped to the activity, intentreceiver, or service that can process the
will look for the most matching boot from all the activity installed in the system via the other properties of intent. If no suitable activity is found, the application gets an exception thrown by the system.Intent's matchThe intent parsing mechanism is primarily to find a matching intent by locating all intentfilter in the androidmanifest.xml and the
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.