Discover android intent action view, include the articles, news, trends, analysis and practical advice about android intent action view on alibabacloud.com
a number of well-defined action types that are already well defined. Here are some common action to start an activity:Intent.action_view its value is "Android.intent.action.VIEW" and when you have some information that you want to show to the user through other activity, you can designate Intent ACTION as Action_
attributes.
Action indicates an abstract Action to be completed by Intent, while Category indicates the Category information appended to the Action.
For example:Java code
Package com. example. testintent;
Import android. app. Activity;
Import
, and the dynamic component will be checked. If the filter is not set, only intent with clearly specified component can be received.
Iii. Intent FilterThe intent filter contains three types of information: Action, data, and category. That is to say, the filter will only compare with the three items in the
running at will.
Transmit intent to any broadcast method (such as context. sendbroadcast (), context. sendorderedbroadcast (), or context. sendstickybroadcast () to all interested broadcast referers. Many broadcas are derived from system code.
In each case, the android system will find the appropriate activity, service or broadcast receiverl to respond to intent
. Application of implicit jump calling system4.1 Browsing Web pages using a browserWeb browser Uri uri= uri.parse ("http://www.baidu.com"); Intent Intent = new Intent (Intent.action_view, URI); StartActivity (Intent);4.2 Calling the mapOpen the map to view the latitude and l
that allows you to select an entry from the content provider specified by the intent URIAction_search launching activities for performing a searchAction_sendto initiates an activity to send a message to the contact specified by the intent URIAction_send initiates an activity that sends the data specified in the intentAction_view general action to process
by the latitude and longitude on the map .The actual purpose of specifying the Data property in Intent-filter is to require that data in the received intent be compliant with the data property specified in Intent-filter, so that the role of the reverse-qualified intent is achieved.For example: In Androidmanifest.xml,
.
The Android Support library provides several specific action view and action provider components. For example, Searchview implements the action view of the input to query, and Shareactionprovider implements an
This blog post mainly introduces the concepts of intent and the usage of intent in activity.
1. Intent implementation process
In Android, intent can be used not only for ApplicationsProgramInteraction between activities and services in an application.
.
For example, in an application maintained by a contact, when we click a contact on the screen of a contact list, we hope to display the Contact Details screen.
To achieve this purpose, listActivity needs to construct an Intent, which is used to tell the system the action we want to view. The object corresponding to this ac
appropriate components to handle the intent message object: An activity or service to perform a request action, or a group of broadcast receivers to respond to a message; For this purpose, Android defines a intent filter class named Intentfilter to accomplish this task; An instance of the Ntentfilter class implements
corresponding activity is detailactivity)
To achieve this purpose, listactivity needs to construct an intent, which is used to tell the system that we want to perform the "View" action. The corresponding viewing object of this action is "a contact ", call startactivity (intent
Notepad program's noteeditor activity has two filter--One launches and displays a specific record to the user to view or edit, and the other initiates an empty record for the user to edit. Filters and security filter and secure a intent filter is not necessarily safe and reliable.An application can allow one of its components to accept implicit intent, but it do
[Android] simulates the action of clicking a specified coordinate on the View, androidview
/*** Simulate clicking a specified coordinate on the View * @ param view * @ param x * @ param y */public void clickView (View
set the property value of the action, and an activity can have multiple category properties. The program can invoke Addcategory (String str) to add the Category property. When a program creates a intent, the intent property that is created automatically starts with a Intent.category_default constant whose value is "Android.intent.category.DEFAULT", so
In fact,
= "Android.intent.action.CALL";Each action has its specific purpose.2.data and extras, which is the data to be manipulated by the action and additional information passed to the target:Here's an example of interacting with a browser:1 /** 2 * Open the specified page 3 * @param view 4 * /5 public void Invokewebbrowser (
system events, and you can also send broadcasts ( sendBroadcast() , sendOrderedBroadcast() , or sendStickyBroadcast() ).
These intent pass, and there will be no overlap. The broadcast intent is passed only to receiver, never to the activity or service, and a intent to the activity is delivered only to the activity, never to a service or receiver. ; and so o
package name and class name.
The function of the jump intent intent = new intent ();//Set the action of the Jump Intent.setaction ("name of the target activity in the manifest file");//settings Categoryintent.addcategory ("category of the target activity in the manifest file");//Activate activity (if required, ad
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.