about launchmode

standard

  • one application
    • the same task
    • add new instance on top
  • multiple application
    • before Lollipop
      • in the caller task
      • add new instance on top
    • since Lollipop
      • target application non existed
        • created a new task , create a new activity instance on top
      • target application task existed
        • create a new activity instance on top of the existed task for the application

singleTop

  • one application
    • the same activity instance on top
      • onNewIntent() it
    • the same activity instance non on top
      • create a new activity instance on top
  • multiple application
    • before Lollipop
      • the same activity instance on top of the caller task
        • onNewIntent() it
      • the same activity instance non on top of the caller task
        • create a new activity instance on the caller task
    • since Lollipop
      • target application task existed
        • the same activity instance on top of the target application task
          • onNewIntent() it
        • the same activity instance non on top of the target application task
          • create a new activity instance on top of the target application task
      • target application task non existed
        • create target application task , create a new activity instance on top of the task

singleTask

  • one application
    • exist activity isntance in the task
      • make it on top of the stack
      • onNewIntent() it
      • destroy activity instances above the the singleTask activity instance (liferecycle)
    • non exist activity instance in the task
      • within taskAffinity
        like this:
      • create a new task
      • create a new activity instance on top of the new task
      • without taskAffinity
        • create a new activity instance on top of the caller task
  • multiple application
    • exist activity instance in system
      • put the task which stacked the activity isntance on top of all tasks
      • remove the activity instances above the singleTask activity instance (liferecycle)
      • onNewIntent() it
    • non exist activity instance in system
      • create a new task
      • put the new task on the top of all tasks
      • create a new activity instance on the top of the new task

singleInstance

  • exist activity instance in system
    • onNewIntent() it
  • non exist activity instance in system
    • create a new task
    • create a new activity instance on top of new task
    some weird appearance
    without taskAffinity attributes, we can only see the top task in the Task Manger, but there're multipul tasks in background.
    within taskAffinity attributes, things seems normal.

I still have questions:

  • Does an application have a special task?
  • How to switch in different tasks?
    • task manager?
    • dumpsys command?
    • relaunch the application icon in launcher?
    • press back button in some cases?

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. JSP连接Mysql的数据库连接池配置相关
  2. MySQL各存储引擎的区别及其启动方法
  3. 数据库_6_SQL基本操作——库操作
  4. AppScan安全问题解决方案
  5. sqlserver2000的jdbc驱动一定要用.exe安
  6. 浅谈MYSQL索引应用(一)
  7. 从MySQL转储中删除DEFINER子句。
  8. 使用VB将Excel导入到Sql中
  9. [SQL Server] 数据库日志文件自动增长导
  10. 通过SQL语句访问远程数据库