android--the difference between explicit and implicit jumps

Source: Internet
Author: User

#创建第二个activity
* Newly created activity, must be configured in the manifest file, otherwise the system can not be found, the display will be directly error


<activity android:name= "Com.itheima.createactivity.SecondActivity" ></activity>
* As long as the following code, then is the portal activity, will generate a shortcut icon


<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>


<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>


* If the activity contains a package with the same name as the application package, you can omit the


1. Create class classes to inherit activity
2. Create the layout file as the activity display content
3. Registering activity in the manifest file
#Activity的跳转
# # #隐式跳转
* One activity if you need an implicit jump, you must add the following child nodes in the manifest file


<intent-filter >
<action android:name= "Com.itheima.sa"/>
<category android:name= "Android.intent.category.DEFAULT"/>
</intent-filter>
* The name of the action node is defined by itself, and when defined, the value of this name becomes the activity action, and when the activity is implicitly started, the action set in the intent must match "com.itheima.sa" exactly.
# # #应用场景
* Display: Activate activity in the same application
* Implicit intent: Activate activity in different applications
* Re-start efficiency, implicit is much lower than the explicit
* If there is more than one activity in the system that matches the action you intend to set, a dialog box will pop up when you start the activity with all the matching activity

android--the difference between explicit and implicit jumps

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.