Android Learning-fifth day

Source: Internet
Author: User

Learning content: Activity interactions, UI fragment components

====activity Interactive = = =

The scenario is typically the current activity requesting another activity display detail (such as personal details), or dealing with associative logic (such as editing a picture)

When two or more of the activity is ready, the basic process is as follows:

1. Add the activity information to the Androidmanifest.xml file as follows:
<manifest xmlns:android= "Http://schemas.android.com/apk/res/android"
package= "Package.name">

<activity
Android:name= ". Cheatactivity "
Android:label= "@string/app_name"/>
</manifest>

android:name Midpoint number indicates that the package in manifest is populated as a prefix

2. Use the Startactivity/startactivityforresult method to start another activity view. The difference between the two methods is whether the information is returned

To the activity caller, the process is as follows:

The interaction between 3.Activity is the use of the intent component, the intent component is responsible for communicating with the OS, information interaction, not directly to the activity between each other

Communication, but the advantage of using intent as a middleware is that you can launch specific activity across apps, and if I request to open a Web page, the corresponding browser should

The activity itself does not require the ability to process Web pages.

Intent: primarily responsible for interacting with the OS, and can carry additional information so that data can be made between two activity

Transmission, it has two forms: display and implicit, the display is explicitly specified activity, generally is the application of the internal situation; The implicit situation is mostly external

Application, because in general I don't know what the external applications are, so make an implicit call and let the specific application respond to my call request!

====ui fragment Components = = = =

Fragment is a flexible UI component attached to the activity, which makes the UI attempt to layout, processing is quite flexible, the current application is more, it has and

Activity-similar lifecycles and view views handle UI interactions, and have their own separate layout files, using the same way as the activity component lei-like!

Fragment focus needs to be familiar with life cycle and management methods:

A) Life cycle

============================================

B) Management method

====================================

Android Learning-fifth day

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.