- 浏览: 1841330 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (665)
- 闲话 (17)
- ruby (1)
- javascript (40)
- linux (7)
- android (22)
- 开发过程 (11)
- 哥也读读源代码 (13)
- JVM (1)
- ant (2)
- Hibernate (3)
- jboss (3)
- web service (17)
- https (4)
- java基础 (17)
- spring (7)
- servlet (3)
- 杂记 (39)
- struts2 (10)
- logback (4)
- 多线程 (2)
- 系统诊断 (9)
- UI (4)
- json (2)
- Java EE (7)
- eclipse相关 (4)
- JMS (1)
- maven (19)
- 版本管理 (7)
- sso (1)
- ci (1)
- 设计 (18)
- 戒烟 (4)
- http (9)
- 计划 (4)
- HTML5 (3)
- chrome extensions (5)
- tomcat源码阅读 (4)
- httpd (5)
- MongoDB (3)
- node (2)
最新评论
-
levin_china:
勾选了,还是找不到
用spring annotation声明的bean,当打包在jar中时,无法被扫描到 -
GGGGeek:
我用的maven-3.5.0,还没有遇到这种情况,使用jar ...
用spring annotation声明的bean,当打包在jar中时,无法被扫描到 -
GGGGeek:
受益匪浅,从组织项目结构,到技术细节,讲的很到位,只是博主不再 ...
一个多maven项目聚合的实例 -
Aaron-Joe-William:
<?xml version="1.0" ...
hibernate逆向工程 -
li272355201:
http://archive.apache.org/dist/ ...
tomcat源码阅读(一)——环境搭建
Even though the activities may be from different applications, Android maintains this seamless user experience by keeping both activities in the same 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.
The device Home screen is the starting place for most tasks. When the user touches an icon in the application launcher (or a shortcut on the Home screen), that application's task comes to the foreground. If no task exists for the application (the application has not been used recently), then a new task is created and the "main" activity for that application opens as the root activity in the stack.
When the current activity starts another, the new activity is pushed on the top of the stack and takes focus. The previous activity remains in the stack, but is stopped. When an activity stops, the system retains the current state of its user interface. When the user presses the BACK key, the current activity is popped from the top of the stack (the activity is destroyed) and the previous activity resumes (the previous state of its UI is restored).
Activities in the stack are never rearranged, only pushed and popped from the stack—pushed onto the stack when started by the current activity and popped off when the user leaves it using the BACK key. As such, the back stack operates as a "last in, first out" object structure.
If the user continues to press BACK, then each activity in the stack is popped off to reveal the previous one, until the user returns to the Home screen (or to whichever activity was running when the task began). When all activities are removed from the stack, the task no longer exists.
A task is a cohesive unit that can move to the "background" when users begin a new task or go to the Home screen, via the HOME key.
Because the activities in the back stack are never rearranged, if your application allows users to start a particular activity from more than one activity, a new instance of that activity is created and popped onto the stack (rather than bringing any previous instance of the activity to the top). As such, one activity in your application might be instantiated multiple times (even from different tasks).
•When Activity A starts Activity B, Activity A is stopped, but the system retains its state (such as scroll position and text entered into forms). If the user presses the BACK key while in Activity B, Activity A resumes with its state restored.
•When the user leaves a task by pressing the HOME key, the current activity is stopped and its task goes into the background. The system retains the state of every activity in the task. If the user later resumes the task by selecting the launcher icon that began the task, the task comes to the foreground and resumes the activity at the top of the stack.
•If the user presses the BACK key, the current activity is popped from the stack and destroyed. The previous activity in the stack is resumed. When an activity is destroyed, the system does not retain the activity's state.
•Activities can be instantiated multiple times, even from other tasks.
you can use these manifest attributes and intent flags to define how activities are associated with tasks and how the behave in the back stack.
Launch modes allow you to define how a new instance of an activity is associated with the current task.
As such, if Activity A starts Activity B, Activity B can define in its manifest how it should associate with the current task (if at all) and Activity A can also request how Activity B should associate with current task. If both activities define how Activity B should associate with a task, then Activity A's request (as defined in the intent) is honored over Activity B's request (as defined in its manifest).
Some the launch modes available in the manifest are not available as flags for an intent and, likewise, some launch modes available as flags for an intent cannot be defined in the manifest.
The affinity indicates which task an activity prefers to belong to. By default, all the activities from the same application have an affinity for each other. So, by default, all activities in the same application prefer to be in the same task.
If the user leaves a task for a long time, the system clears the task of all activities except the root activity. When the user returns to the task again, only the root activity is restored. The system behaves this way, because, after an extended amount of time, users likely have abandoned what they were doing before and are returning to the task to begin something new.
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.
The device Home screen is the starting place for most tasks. When the user touches an icon in the application launcher (or a shortcut on the Home screen), that application's task comes to the foreground. If no task exists for the application (the application has not been used recently), then a new task is created and the "main" activity for that application opens as the root activity in the stack.
When the current activity starts another, the new activity is pushed on the top of the stack and takes focus. The previous activity remains in the stack, but is stopped. When an activity stops, the system retains the current state of its user interface. When the user presses the BACK key, the current activity is popped from the top of the stack (the activity is destroyed) and the previous activity resumes (the previous state of its UI is restored).
Activities in the stack are never rearranged, only pushed and popped from the stack—pushed onto the stack when started by the current activity and popped off when the user leaves it using the BACK key. As such, the back stack operates as a "last in, first out" object structure.
If the user continues to press BACK, then each activity in the stack is popped off to reveal the previous one, until the user returns to the Home screen (or to whichever activity was running when the task began). When all activities are removed from the stack, the task no longer exists.
A task is a cohesive unit that can move to the "background" when users begin a new task or go to the Home screen, via the HOME key.
Because the activities in the back stack are never rearranged, if your application allows users to start a particular activity from more than one activity, a new instance of that activity is created and popped onto the stack (rather than bringing any previous instance of the activity to the top). As such, one activity in your application might be instantiated multiple times (even from different tasks).
•When Activity A starts Activity B, Activity A is stopped, but the system retains its state (such as scroll position and text entered into forms). If the user presses the BACK key while in Activity B, Activity A resumes with its state restored.
•When the user leaves a task by pressing the HOME key, the current activity is stopped and its task goes into the background. The system retains the state of every activity in the task. If the user later resumes the task by selecting the launcher icon that began the task, the task comes to the foreground and resumes the activity at the top of the stack.
•If the user presses the BACK key, the current activity is popped from the stack and destroyed. The previous activity in the stack is resumed. When an activity is destroyed, the system does not retain the activity's state.
•Activities can be instantiated multiple times, even from other tasks.
you can use these manifest attributes and intent flags to define how activities are associated with tasks and how the behave in the back stack.
Launch modes allow you to define how a new instance of an activity is associated with the current task.
As such, if Activity A starts Activity B, Activity B can define in its manifest how it should associate with the current task (if at all) and Activity A can also request how Activity B should associate with current task. If both activities define how Activity B should associate with a task, then Activity A's request (as defined in the intent) is honored over Activity B's request (as defined in its manifest).
Some the launch modes available in the manifest are not available as flags for an intent and, likewise, some launch modes available as flags for an intent cannot be defined in the manifest.
The affinity indicates which task an activity prefers to belong to. By default, all the activities from the same application have an affinity for each other. So, by default, all activities in the same application prefer to be in the same task.
If the user leaves a task for a long time, the system clears the task of all activities except the root activity. When the user returns to the task again, only the root activity is restored. The system behaves this way, because, after an extended amount of time, users likely have abandoned what they were doing before and are returning to the task to begin something new.
发表评论
-
最近半个月开发小结
2011-12-05 22:16 13081、有一个方法,有一段 ... -
android培训文档提纲(四)
2011-11-27 23:28 12451、生命周期方法onSaveInstanceState()是在 ... -
上周开发过程中几个简单问题的总结
2011-11-21 13:18 1357上周开发中组员遇到几个问题,都不是大问题,但都耽搁了一些时间。 ... -
android培训文档提纲(三)
2011-11-12 23:47 17631、Activity和Service组件是Context的子类 ... -
android的Log组件和logcat命令
2011-11-12 23:03 6318项目进入开发阶段了, ... -
android培训文档提纲(二)
2011-11-07 21:10 1661一、Each Activity can make an ... -
android培训文档提纲(一)
2011-10-23 14:05 1603最近项目快要进入开发 ... -
顶部有一排按钮,最底下还有FooterView的ListView页面
2011-08-13 15:46 3298先上效果图: 下面详细说说这个页面是怎么做出来的: 1、 ... -
实现屏幕下方展示的TAB分页
2011-08-09 23:22 2174这篇博客是参考helloandroid兄的腾讯微博应用,我整理 ... -
PendingIntent
2011-08-08 16:02 1559在开发SMS等应用时,有时调用相关的API会要求提供一个类型为 ... -
android数据持久化总结
2011-08-06 12:23 19181、 通过Context.getSharedPreferenc ... -
intent and service
2011-08-04 00:07 1420明天才开始讨论包需求 ... -
最近两周android总结
2011-08-01 23:42 1611最近2周预研做得差不多 ... -
没有单元测试,怎能写代码
2011-07-25 17:56 1569项目前期的技术点预研完成了,最近开始做原型开发。 之前没有在 ... -
android process and thread
2011-07-18 16:31 1688前三周android预研中,把可能用到的技术点都识别了,并完成 ... -
android第三周小结
2011-07-18 10:16 13611. 系统自带的通讯录应用,联系人名单保存在data/data ... -
onPause()方法的特殊性
2011-07-15 17:11 2925onPause(), onStop(), onDestroy( ... -
activity存在的三种状态
2011-07-15 16:44 1773An activity can exist in essent ... -
android第二周小结
2011-07-14 10:50 11621. 做了短信侦听的Broadca ... -
android一周小结
2011-07-04 21:26 1228做了一周android预研,总结以下几条: 1. 用DDMS ...
相关推荐
六、Tasks and Back Stack: 1. 管理Task:Task是Android中的一系列Activity堆栈,代表用户的操作序列。每个Task有自己的Back Stack,用于存储按启动顺序排列的Activity。 2. 定义launch模式:在AndroidManifest.xml...
系统会自动管理一个返回堆栈(Tasks and Back Stack)或历史屏幕列表,记录用户访问过的屏幕顺序。然而,在特定情况下,开发者可能需要重写返回键的默认行为,以适应应用的特定需求。例如,在应用中嵌入了网页浏览器...
9. **任务和栈(Tasks and Back Stack)** 活动可以组织在任务(Task)中,每个任务都有一系列的回退栈。默认情况下,新启动的活动会被添加到当前任务的栈顶,但可以使用Intent标志(如FLAG_ACTIVITY_NEW_TASK)来...
We then look at how to provision databases in self-service mode, and how to perform administration tasks such as backup and recovery, and fine-tuning databases. At the end of the book, we will ...
chapter explains how to record and play back messages using rosbag and rqt_bag. Chapter 4, 3D Modeling and Simulation, constitutes one of the first steps in order to implement your own robot in ROS. ...
Stack segment and stack pointer. Data segment DS and addressing. Addressing types and instruction coding. Programming at processor level: mnemonics and the assembler. Addressing types. ...
=) Programmers can finally focus on their tasks instead of waiting for (and sometimes fighting with) the external IDE’s to run, load the correct script, or jump to the correct line. Main features: ...
The SSM stack is a popular choice for building web applications in Java due to its flexibility, modularity, and efficient handling of business logic and data persistence. The tags "毕业设计" and ...
1. **任务与活动(Tasks and Activities)** - 在Android中,任务(Task)是一组相关的Activity堆栈,它们按照启动的顺序排列,最新的Activity位于栈顶。任务管理器负责维护这些Activity的生命周期。 2. **...
9.6 Interrupt Tasks and Interrupt Procedures 9.7 Error Code 9.8 Exception Conditions 9.9 Exception Summary 9.10 Error Code Summary Chapter 10 Initialization 10.1 Processor State After Reset 10.2 ...
23. The five layers in the Internet protocol stack are – from top to bottom – the application layer, the transport layer, the network layer, the link layer, and the physical layer. The principal ...
Android应用是基于任务(Task)和栈(Back Stack)的概念运行的,Activity会被压入栈中,当用户切换到其他Activity时,新Activity会被压入栈顶,而原来的Activity则被压在下面。因此,栈顶的Activity就是当前用户...
对于大多数常规应用需求,如导航和回退,Android框架已经提供了标准的处理方式,如使用Intent和back stack。只有在特定场景下,如全局监听或调试,才需要考虑直接获取栈顶Activity。 总的来说,理解和掌握如何获取...
If the task fails, the first move to a place, over time retry the put back, and so on ... There are many possible places to use it ... so, still retained 2. How many tasks can be complicated to ...