活动开始在Android中清除顶部 [英] Start Activity clearing top in Android

查看:133
本文介绍了活动开始在Android中清除顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在堆栈中的下列活动:

I have the following Activities in my stack:

A , B , C, D 

我要重新启动中的B为了得到这个堆栈:

I want to relaunch B in order to get this stack:

A , B'

其中B'是一种新型B实例(不老收到onNewIntent回调,我该怎么办呢?

Where B' is a new B instance (not the old receiving a onNewIntent callback, how can I do it?

顺便说一句,我使用的是

By the way I'm using a

intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

启动B活性,但是这种方式onNewIntent叫,而不是开始一个新的实例时

when launching the B activity but this way the onNewIntent is called instead of start a new instance

推荐答案

采用Android:在清单文件中特定的活动noHistory = true来clear.Hope这可能会解决您的问题。

Use android:noHistory=true in manifest file for particular activity to clear.Hope this might solve your issue.

这篇关于活动开始在Android中清除顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆