found by her sister.
The conditions are all together.
Generally, Intent only specifies one Action, but multiple Category can be specified.2.2.3 specify Action and Category to call system Activity
Click to open the corresponding table of Action and Category.2.2.4 Data and Type attributes and intent-filter configuration
The Data property is usually used to provide operation Data to the Action property. The D
that the action in multiple action,intent is exactly the same as any of the actions in the string (note, case sensitive), and the action aspect matches successfully. You can set the action for intent by using the Setaction method, or you can pass in the action when constructing intent. It is important to note that an implicit
) 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 action list of the intentfilter of the target component must contain
This example describes the interactive core intent usage between Android components. Share to everyone for your reference, specific as follows:
Starting from one activity to another can use the StartActivity () method or the Startactivityforresult () method
First: Start an activity directly
Intent Intent = ne
Activity
In Android, Activity is the foundation of all programs, and the processes of all programs run in Activity. Activity has its own life cycle (see examples ).OnSaveInstanceStateSave Its status ).
The key to an Activity is itsLifecycleThe second step is the state storage and recovery (onSaveInstanceState onRestoreInstanceState), as well as the jump between activities and data transmission (Intent).
Co
We know that intent is primarily used to activate Android components, so how exactly is it activated? Can I bring Java objects when I activate? Why should objects be serialized before they are passed?
First, intent official website explanationintent can be used by startactivity to load an activity, or it can be sent to a specified Broadreceiver component by Broa
the entrance of the program).3. Test the Data property. Intent can define a maximum of 1 data, and the filter defines multiple data.The criteria for passing the data test are:A. If intent does not specify the data and data type, only the filter with data and date type is not defined to pass the test;B. If intent defines that data does not have a data type define
IntentIt should be something special in Android. You can specifyProgramThe action to be executed (such as view, edit, dial), andMaterials. After all settings are specified, you only need to call startactivity (), AndroidSystemWill automatically find the most suitable for your specified requirementsApplicationProgram, and execute the program.
★Intent Daquan:
1. Search for content from Google
data property is typically used to provide the Action property with the information of the operation. The Data property accepts a URI object, and the URI string always satisfies the following format: Scheme://host:port/path
The Type property is used to specify the MIME type for the URI specified by the data, which can be any custom MIME type, as long as the string conforms to the ABC/XYZ format.
The extra property is typically used to exchang
types that can be executed by a component. You can use any combination of attributes to specify the data supported by your component:
Android: Create a valid host name, such as google.com.
Android: mimetype specifies the data type that can be executed by the component. For example, it matches all Android cursor
A
, but it cannot omit any category in this intent.Therefore, in principle, a non-classification intent object should always be able to pass the test, regardless of what is in the filter. This is true in most cases. With one exception, Android treats all the implicit intent sent to startActivity () as containing at least one category: "
Display webpage:
1. Uri uri = URI. parse ("http://www.google.com ");2. Intent it = new intent (intent. action_view, Uri );3. startactivity (it );
Display map:
1. Uri uri = URI. parse ("Geo: 38.899533,-77.036476 ");2. Intent it = new intent (
passed to any broadcast method (such as Context. sendBroadcast (), Context. sendOrderedBroadcast (), or Context. sendStickyBroadcast () is passed to all interested broadcast recipients. Many types of broadcast come from system code.
In each example, the Android system finds an appropriate activity, service, or a group of broadcast recipients to respond to this intent and instantiate them if necessary. The
looking up all the Application package information) to find the component that can handle this intent. In this parsing process, Android is judged by the three attributes of the action, type, and category of intent, judging by the following:1.1 If the action is specified by intent, the action must be included in the In
mismatch, it will not match;
For example:
Intent intent = new intent ();
Intent. setaction ("");// This statement only specifies the action
Startactivity (intent );// Find the most matched component for activation. Intent. addcat
Android-Intent action summary (to) and androidintent
String ADD_SHORTCUT_ACTION: Add a shortcut to the system .. "Android. intent. action. ADD_SHORTCUT"String ALL_APPS_ACTION: lists all available applications.Input: none. "Android. inten
this intent. In this parsing process, Android is judged by the three attributes of the action, type, and category of intent, judging by the following:1.1 If the action is specified by intent, the action must be included in the Intentfilter action list of the target component, otherwise it will not match;1.2 If the
to.Implicit intent: Intent that do not explicitly specify the component name are implicit intent. The Android system handles this intent by finding the most appropriate component for the action, category (category), data (URI, and data type) set in the implicit
This article summarizes the common intent action features of Android. Share to everyone for your reference, specific as follows:
Android's basic design philosophy is to encourage the reduction of coupling between components, so Android provides intent (intent),
Example of Intent. Action in common Android SystemsACTION_MAIN android. intent. action. MAIN application portalACTION_VIEW android. intent. action. VIEW displays data to users.ACTION_ATTACH_DATA
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.