Android Learning note "06"

Source: Internet
Author: User

First, create a new activity

Ii. Implicit Intent

Specify a set of actions or data opening intent

Implicit intent: Open Other apps

Iii. Explicit Intent

By specifying a specific package name and class name

Explicit intent: applying an internal jump

Four, the character calculator

Explicit intent jump Interface (pass data)

Five, SMS Daquan

Implicit intent Jump Interface (pass data)

Six, SMS transmitter

The main interface to send SMS (Smsmanager, System upper application source), respectively, jump to select the number and SMS content interface, select the data back to the main interface

Callback data, multiple activity callback data, using the request code and return code to distinguish

Vii. Activity life Cycle

OnCreate: Creating

OnDestroy: Destruction

Onstart/onrestart: Interface Visible

OnStop: Interface not visible

Onresume: Controls on the interface get focus

OnPause: The control on the interface loses focus

Eight, the screen to switch activity life cycle

CTRL+F11 Simulator Toggle Screen

Activity configuration:

android:screenorientation= "Portrait"--Fixed to vertical screen

android:screenorientation= "Landscape"--fixed to horizontal screen

Nine, the concept of the task stack

A task stack for an application

X. Four types of activation modes of activity

Activity configuration startup mode: Launchmode

Singletop: Stack top only one

If the activity on the stack at the top of the task stack exists, it will not recreate the activity, directly reusing the existing activity, only one at the top of the stack. Application: Browser bookmarks

Singletask: The entire stack is only one (when reused, all other activity on its stack is cleared out of the stack)

When the activity is turned on, check that the stack is already present, and if it exists, it will be reused, and all other activity on the activity stack will be emptied, only one in the entire task stack . Application: Browser

SingleInstance: Create a single stack save

This mode activity runs on a separate stack, only one in the entire mobile phone operating system . Application: Call

Android Learning note "06"

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.