如何关闭活动而不实际完成?

时间:2012-05-30 12:53:08

标签: java android

我想:

open 1, 2, 3 activities
1 > 2 > 3  

back to #2
1 > 2

open #4 activity
1 > 2 > 4

back to #2
1 > 2

restore #3 activity
1 > 2 > 3

“恢复”表示打开以前关闭的活动而不重新创建。 我怎么能这样做?

谢谢!

1 个答案:

答案 0 :(得分:6)

open 1, 2, 3 activities
1 > 2 > 3  

back to #2
1 > 2          // call startActivity for 2, don't call finish() in 3

open #4 activity
1 > 2 > 4

back to #2
1 > 2

restore #3 activity
1 > 2 > 3      // call startActivity for 3 with intent as Intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_To_FRONT);