实验方案1:
Main1Activity调用Main2Activity,Main2Activity调用Main3Activity,Main3Activity调用Main1Activity,然后依此返回看结果
1. FLAG_ACTIVITY_NEW_TASK:
04-10 14:26:05.793: I/System.out(20278): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate04-10 14:26:18.626: I/System.out(20278): com.example.a1.Main2Activity@a16ffa5Main2Activity onCreate
04-10 14:26:21.707: I/System.out(20278): com.example.a1.Main3Activity@4801c15Main3Activity onCreate
04-10 14:26:23.056: I/System.out(20278): com.example.a1.Main1Activity@42475fcMain1Activity onCreate
返回
04-10 14:26:25.889: I/System.out(20278): com.example.a1.Main3Activity@4801c15Main3Activity onDestroy
04-10 14:26:26.521: I/System.out(20278): com.example.a1.Main2Activity@a16ffa5Main2Activity onDestroy
04-10 14:26:27.138: I/System.out(20278): com.example.a1.Main1Activity@1887d7dMain1Activity onDestroy
2. FLAG_ACTIVITY_SINGLE_TOP
04-10 14:27:16.256: I/System.out(20734): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate04-10 14:27:29.947: I/System.out(20734): com.example.a1.Main2Activity@a16ffa5Main2Activity onCreate
04-10 14:27:31.341: I/System.out(20734): com.example.a1.Main3Activity@4801c15Main3Activity onCreate
04-10 14:27:32.592: I/System.out(20734): com.example.a1.Main1Activity@42475fcMain1Activity onCreate
返回
04-10 14:27:39.090: I/System.out(20734): com.example.a1.Main3Activity@4801c15Main3Activity onDestroy
04-10 14:27:39.773: I/System.out(20734): com.example.a1.Main2Activity@a16ffa5Main2Activity onDestroy
04-10 14:27:40.451: I/System.out(20734): com.example.a1.Main1Activity@1887d7dMain1Activity onDestroy
3. FLAG_ACTIVITY_CLEAR_TOP
04-10 14:29:42.204: I/System.out(21268): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate04-10 14:29:45.014: I/System.out(21268): com.example.a1.Main2Activity@873f99cMain2Activity onCreate
04-10 14:29:45.837: I/System.out(21268): com.example.a1.Main3Activity@df701ccMain3Activity onCreate
04-10 14:29:47.532: I/System.out(21268): com.example.a1.Main2Activity@873f99cMain2Activity onDestroy
04-10 14:29:47.541: I/System.out(21268): com.example.a1.Main1Activity@1887d7dMain1Activity onDestroy
04-10 14:29:47.563: I/System.out(21268): com.example.a1.Main1Activity@c613485Main1Activity onCreate
04-10 14:29:47.831: I/System.out(21268): com.example.a1.Main3Activity@df701ccMain3Activity onDestroy
返回
4.FLAG_ACTIVITY_REORDER_TO_FRONT
04-10 14:35:39.421: I/System.out(22240): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate04-10 14:35:42.197: I/System.out(22240): com.example.a1.Main2Activity@873f99cMain2Activity onCreate
04-10 14:35:46.156: I/System.out(22240): com.example.a1.Main3Activity@df701ccMain3Activity onCreate
重新调用1887d7dMain1Activity的onStart
返回
04-10 14:36:08.378: I/System.out(22240): com.example.a1.Main3Activity@df701ccMain3Activity onDestroy
04-10 14:36:08.969: I/System.out(22240): com.example.a1.Main2Activity@873f99cMain2Activity onDestroy
实验方案2:
Main1Activity调用Main1Activity,然后依此返回看结果
1. FLAG_ACTIVITY_NEW_TASK:
04-10 14:15:20.893: I/System.out(17454): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate
04-10 14:15:24.110: I/System.out(17454): com.example.a1.Main1Activity@217550fMain1Activity onCreate
返回
04-10 14:15:26.995: I/System.out(17454): com.example.a1.Main1Activity@217550fMain1Activity onDestroy
04-10 14:15:28.063: I/System.out(17454): com.example.a1.Main1Activity@1887d7dMain1Activity onDestroy
2. FLAG_ACTIVITY_SINGLE_TOP:
04-10 14:16:53.263: I/System.out(17992): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate
返回
3. FLAG_ACTIVITY_CLEAR_TOP:
04-10 14:09:52.882: I/System.out(16952): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate
04-10 14:09:58.800: I/System.out(16952): com.example.a1.Main1Activity@217550fMain1Activity onCreate
04-10 14:09:59.014: I/System.out(16952): com.example.a1.Main1Activity@1887d7dMain1Activity onDestroy
返回
04-10 14:10:02.967: I/System.out(16952): com.example.a1.Main1Activity@217550fMain1Activity onDestroy
4.FLAG_ACTIVITY_REORDER_TO_FRONT:
04-10 14:18:38.925: I/System.out(18498): com.example.a1.Main1Activity@1887d7dMain1Activity onCreate
返回
04-10 14:18:44.889: I/System.out(18498): com.example.a1.Main1Activity@1887d7dMain1Activity onDestroy