android--explicit jumps and implicit jumps using different methods

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>
* Just have the following code, then the entry activity. A shortcut icon will be generated


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


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


* Assuming that the activity's package has the same name as the application package name, you can omit the non-writable


1. Create class classes to inherit activity
2. Create the layout file as the activity display content
3. Register activity in the manifest file
#Activity的跳转
# # #隐式跳转
* An activity hypothesis requires an implicit jump, so you must add the next face node 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 custom and defined. The value of this name will be the activity action, and when the activity is implicitly started, the action set in the intent must match the "com.itheima.sa".
# # #应用场景
* Display: Activate activity in the same application
* Implicit intent: Activate activity in different applications
* Re-start efficiency, implicit is much lower than the explicit
* Assuming that there are multiple actions in the system that match the action you intend to set, then when you start the activity. A dialog box will pop up that includes all the matching activity

android--explicit jumps and implicit jumps using different methods

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.