Android learning-day 5 and day 5
Learning Content: Activity Interaction and UI Fragment Components
=== Activity INTERACTION ====
The application scenario is generally that the current Activity requests another Activity to display details (such as personal details), or to process Association logic (such as editing images)
When two or more activities are ready, the basic processing process is as follows:
1. Add activity information to the AndroidManifest. xml file, as shown below:
<Manifest xmlns: android = "http://schemas.android.com/apk/res/android"
Package = "package. name">
<Activity
Android: name = ". CheatActivity"
Android: label = "@ string/app_name"/>
</Manifest>
Android: indicates that the package in manifest is prefixed and registered.
2. Use startActivity/startActivityForResult to start another Activity view. The difference between the two methods is whether to return information.
Call Activity. The process is as follows:
3. The Intent component is used for interaction between activities. The Intent component is mainly responsible for communication and information interaction with the OS, and does not directly allow interaction between activities.
Communication, but uses Intent as the middleware. The advantage is that it can start a specific Activity across applications. If I request to open a webpage, the corresponding browser should
The Activity itself does not need to be able to process webpages.
Intent Brief Introduction: it is mainly responsible for interactive communication with the OS and can carry additional information so that data can be performed between two activities.
Transmission, which has two forms: Display and implicit. The display specifies the Activity explicitly, which is generally internal to the application.
Application. In general, I don't know which external applications are available, so I need to make implicit calls so that specific applications can respond to my call requests!
=== UI Fragment component ====
Fragment is a flexible UI component attached to the Activity, which makes the UI layout attempt and processing quite flexible. Currently, there are many applications, and it has
Similar to Activity, the life cycle and View can process UI interaction, and have their own layout files. The usage is similar to Activity components!
Fragment focuses on familiarity with lifecycle and management methods:
A) Lifecycle
========================================================== ====
B) Management Method
==========================================