Elaborate on Android attributes

Source: Internet
Author: User

Android attributes include: Easier design and integration, expanded deployment options, more diverse logon and personalized services, and better data access and synchronization, I hope you can get the information you want.

And call startActivity (). At this time, the map component can display the map. When you click the "back" button, your activity will be displayed on the screen again. For users, even if the map program is defined in another program and runs in another process, it looks like a part of your program.

Android properties put two activities in one task, so that users can have this experience. The activities are arranged in a stack. The root activity in the stack is the start of the task, or the first activity of the application selected by the user. The activity at the top of the stack is the currently running activity, which is currently attracting user attention.

When an activity starts another activity, the new activity is pushed to the stack and changes to the current activity. The previous activity is still in the task. When the user clicks BACK), the current acitivity is popped up and the previous activity is running. If there are multiple instances of the same activity in the stack, if there are multiple map viewers, such as multiple map viewer portals configured by the Program), the stack cannot be re-ordered, only pop-up and press-in are allowed.

A task is a activities stack rather than a class in the packing list. Therefore, you cannot leave the activity to set a stack value separately. For example, the following chapter will talk about 'attractiveness of the task', Which is set in the Root activity of the task.

All activities in the task are moved as a whole. The entire task can be run in the foreground) or background. Imagine, for example, there is a task with four activities. The user clicks the "HOME" key and returns to the place where the program starts. selecting a new program is actually a new task ).

The current task is moved to the background for running. The root activity of the new task is displayed. After a while, the user returns to the HOME page and selects the task of the program just now ). Then the task containing four activities will return to the foreground for running. When the user clicks the BACK button, the screen does not show the activity that the user just left, but the activity at the top of the stack is popped up, displaying the previous activity.

By default, the above descriptions are correct. Of course, there are also many ways to change the following: the relationship between the task and the activity, the action of an activity in the task. These are flags set by the Intent object to start this acivity) and the activity is controlled by the <activity> node in the packing list.

Intent flag set includes:

 
 
  1. FLAG_ACTIVITY_NEW_TASK   
  2. FLAG_ACTIVITY_CLEAR_TOP   
  3. FLAG_ACTIVITY_RESET_TASK_IF_NEEDED   
  4. FLAG_ACTIVITY_SINGLE_TOP 

Typical <activity> node attributes are as follows:

 
 
  1. taskAffinity   
  2. launchMode   
  3. allowTaskReparenting   
  4. clearTaskOnLaunch   
  5. alwaysRetainTaskState   
  6. finishOnTaskLaunch 

This article describes in detail the meanings and interactions between these tags and Android attributes.

Related Article

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.