manage task comments

来源:互联网 发布:淘宝查排名软件哪个好 编辑:程序博客网 时间:2024/05/23 18:32
  1. concepts
    1.1 Overview Screen : The overview screen (also referred to as the recents screen, recent task list, or recent apps) is a system-level UI that lists recently accessed activities and tasks. The user can navigate through the list and select a task to resume, or the user can remove a task from the list by swiping it away.
    1.2 Activity: An activity represents a single screen with a user interface.
    1.3 Task: A task is a collection of activities that users interact with when performing a certain job. The activities are arranged in a stack (the back stack), in the order in which each activity is opened.
    1.4 Affinity :
    1.4.1 Activities with the same affinity conceptually belong to the same task (to the same “application” from the user’s perspective).
    1.4.2 The affinity of a task is determined by the affinity of its root activity.

    Some points when the normal task

    1. When new activity need to be started
      1) create a new one
      1.1 ) one this task
      1.2 ) in new task
      2) bring an old one
    2. When user leave the task
      1.1 ) leave as it is
      1.2 ) delete all except root activity
    3. When user continue the task

在调用activity同被调用的activity的launch冲突时,调用的activity的指定值优先。

a. 影响创建activity的标志
a.1) launchMode == standard
a.2)launchMode == singleTop, 等同于intent.flag == FLAG_ACTIVITY_SINGLE_TOP
a.3) launchMode == singleTask ,等同与intent.flag == FLAG_ACTIVITY_NEW_TASK,在找task时寻找目标task的affinity必须等同于此activity的affinity
a.4) launchMode == singleInstance,还影响此activity启动的其他activity

b) FLAG_ACTIVITY_CLEAR_TOP。当 launchMode == singleTask时,找到了目标task,但activity可能不位于stacktop,不能显示,使用此标记清除在目标activity上的activity

c)与创建无关 allowTaskReparenting In this case, the activity can move from the task it starts to the task it has an affinity for, when that task comes to the foreground.

d)activity 删除。
alwaysRetainTaskState
If this attribute is set to “true” in the root activity of a task, the default behavior just described does not happen. The task retains all activities in its stack even after a long period.
clearTaskOnLaunch
If this attribute is set to “true” in the root activity of a task, the stack is cleared down to the root activity whenever the user leaves the task and returns to it. In other words, it’s the opposite of alwaysRetainTaskState. The user always returns to the task in its initial state, even after a leaving the task for only a moment.
finishOnTaskLaunch
This attribute is like clearTaskOnLaunch, but it operates on a single activity, not an entire task. It can also cause any activity to go away, including the root activity. When it’s set to “true”, the activity remains part of the task only for the current session. If the user leaves and then returns to the task, it is no longer present.

0 0
原创粉丝点击