`
007007jing
  • 浏览: 41265 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

android2.3 api demo 学习系列(12)--App/Activity/Reorder Activitys

阅读更多

Reorder Activitys Demo主要是实现打开activity的方式的改变。本次demo涉及到三个activity : ReorderOne、ReorderTwo、ReorderThree。

按照默认的方式执行startActivity,三个activity依次压入stack中:

这个时候ReorderThree如果还是按照默认的方式打开ReorderOne(前提:manifest没有设置activity的flags),则会新建一个ReorderOne压入stack top“

如果ReorderThree中打开ReorderOne时设置flags那么会根据设置的具体方式打开ReorderOne:

 

Intent intent = new Intent(ReorderThree.this,ReorderOne.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);

 这里的示例代码设置flags为Intent.FLAG_ACTIVITY_REORDER_TO_FRONT重新排序到最前:

具体的flag大家参考sdk研究吧。本次demo就介绍到这里。因为没有什么新的知识内容就不在赘述和贴代码效果图了。谢谢

  • 大小: 1.6 KB
  • 大小: 2 KB
  • 大小: 1.5 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics