android 返回销毁活动,android返回活动时会被销毁并且不会恢复
你想用:
FLAG_ACTIVITY_REORDER_TO_FRONT
來自Android docs的報價:
If set in an Intent passed to Context.startActivity(), this flag will
cause the launched activity to be brought to the front of its task’s
history stack if it is already running.
For example, consider a task consisting of four activities: A, B, C,
D. If D calls startActivity() with an Intent that resolves to the
component of activity B, then B will be brought to the front of the
history stack, with this resulting order: A, C, D, B. This flag will
be ignored if FLAG_ACTIVITY_CLEAR_TOP is also specified.
public static Intent createIntent(Context context)
{
Intent i = new Intent(context, Feed.class);
i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
return i;
}
總結
以上是生活随笔為你收集整理的android 返回销毁活动,android返回活动时会被销毁并且不会恢复的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java高级语法笔记-文件操作-链表的存
- 下一篇: 专业课程设计之客户与服务器程序的同步与通