Android Application Framework with borderless design intent, android with borderless design intent
The description of the feature space outside the Android Application Framework is clearly described in the SDK documentation, and the basic concepts and component lifecycles of
system obtains the data type from the data. Like action, the Data Type list of the target component must contain the intent data type. Otherwise, the data type does not match.
If the data in the intent is not a content: Type Uri and the intent does not explicitly specify its type, it will match according to the scheme
Android Intent and android Intent
1 ntent. setType ("image/*"); // image Format 2 3 intent. setType ("audio/*"); // select audio 4 5 intent. setType ("video/*"); // select the video (mp4 3gp is the video format supported by
uri.
Start Activity
1. Display startup: the class of the started Activity must be specified.
// Create an Intent application context target component
Print?
Intent intent = new Intent (IntentDemo01Activity. this,
ActivityToStart. class );
// Display start Activity
StartActivity (i
matches the URI of the filter. Either the URI of the intent object is content: or file:, and filter does not specify a URI.If a intent can pass more than one activity or service filter, then the user may be asked which one to start.If none of them is true, then an exception is thrown. Common cases common situation the last rule above (d) illustrates that a component can typically fetch data from files and
Intent indicates the Android app's "intention" to start. The Android app starts a specified component based on the Intent. The actual component to start depends on the Intent attributes.
1. explicit Intent
Specifies the
:
However, it is recommended that you do not specify only the URI but not the type of the intent to operate on the data. Because this usually matches a lot
C. If a intent only specifies the type but does not specify the URI, it can only match the intentfitler that only specifies the corresponding type and does not specify scheme.
D. if an
"); StartActivity (Intent);4.6 Call SMS program (no need to send SMS permission) Uri uri = uri.parse ("smsto:10086");//Specify receiver Intent Intent = new Intent (intent.action_sendto, URI); Intent.putextra ("Sms_body", "You this black-hearted operator"); StartActivity (
Intent is often used in Android. Whether it is the page pull, or pass data, or call external programs, the system functions are used to intent. After doing some examples of intent, finishing a bit of intent, hope to be useful to everyone. Because
Android --- 8 --- Intent and use Intent to transmit data, androidintent
Intent is an important way to interact with each component in the Android program. It not only specifies the current group
You can also transfer data between different components.
In the first article, we've seen how to use intent to launch new application components, but in fact they can also use the Sendbroadcast method to broadcast messages anonymously between components.As a system-level messaging mechanism, intent can send structured messages between processes. Therefore, the broadcast receiver is implemented to monitor and respond to these broadcast
Intent is one of the important bridges in Android, and it is divided into explicit intent and implicit intent. These two intentions are then explained separately.
Explicit intent: Activates activity within the app by specifying a set of data or actions (this is safe
Android's basic design philosophy is to encourage the reduction of coupling between components, so Android provides Intent (intent), Intent provides a generic messaging system that allows you to pass Intent between your application and its other applications to perform actio
, the
For example, let's look at what the browser application will do when a user clicks a link on a webpage. First, it will try to display the data (if the link is an HTML page, it will be displayed ). If the data cannot be displayed, the scheme and data type will be put together in an implicit intent object, and an activity that can do the work will be started. If there is no recipient, it will require
ObjectiveThis article mainly introduces the Android Intent, and analyzes the Intent query matching process from the point of view of the Android source code.
Intent IntroductionIntent's Chinese is meant to be "intent," and
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 activities ).
For an activity, the key is its life cycle (for example,), followed by the state storage and recovery (onsaveinstancestate onrestoreinstancestate), and inter-activity jump and data transmission (intent ).
Common functions in activity include
We have learned how to call an activity in a single application. However, an important aspect in android development is to use intent to call the activity of other applications. In particular, your application can call many "built-in" applications in the system. The so-called "built-in" application refers to applications at the same level, such as Browser, Phone, and Sms. For example, if your application ne
1. Intent. action_chooser = "android. Intent. Action. chooser" indicates an activity selector.Intent provides a static createchooser method, allowing us to easily create such an intent. For specific usage examples, refer to the startwallpaper function of launcher. Java in the launcher application:Private voidStartwallp
First, let's look at the Network Statement:
Android. Intent. Action. Main determines the applicationProgramThe first
Activity Android. Intent. Category. launcher determines whether the application is displayed in the program list. After the experiment, I found a problem?
Main and launcher are not independent tasks;
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.