使用ActivityGroup进行页面切换
如果在切换的时候,不需要缓存页面内容,则代码:
container.removeAllViews();
container.addView(lam.startActivity("ag1", new Intent()
.setClass(this, AG1Activity.class) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
).getDecorView());
如果需要缓存数据,就不能加addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
本文介绍了如何使用ActivityGroup在不缓存页面内容时进行页面切换,并解释了何时需要及何时不需要缓存数据。
975

被折叠的 条评论
为什么被折叠?



