【发布时间】:2012-05-15 18:07:02
【问题描述】:
我有 3 个活动(表格 1 ,2 ,3 ) 在用户填写表格 3 并发送后,我想从活动(1 & 2 & 3)中删除信息,但在活动 3 中发送后
(我的意思是如果用户在发送后点击返回,我不想让他在表格 1 & 2 & 3 中找到他的信息
.Intent intent = new Intent(getApplicationContext(), Home.class);
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
当他在活动 3 之后单击返回时,这是否让我的 1 & 2 & 3 活动没有用户数据? 你能帮我么? ===================编辑================
有人告诉我,但我不明白,你能帮我怎么做吗
pass a reference to the previous forms in the last one and call clear on any element
谢谢大家
【问题讨论】:
-
不,那个标志对你没有帮助,你需要回到 1 和 2 还是你可以从堆栈中清除它们?
-
如果用户还没有按表格 3 中的发送,那么我不想清除 1 和 2,但如果他按表格 3 中的发送,那么我的应用程序会将他移到我家,我想清除1 & 2 & 3,我该怎么做
-
好的,我明白了。您可以使用静态标志来识别表单是否已发送。成功发送表单后,您可以更改标志值并根据标志值重置表单数据