简体   繁体   English

清单中的android:excludeFromRecents =“ true”

[英]android:excludeFromRecents=“true” in manifest

I have 3 Activities A, B, C. 我有3个活动A,B,C。

In manifest.xml, A and B are secured with android:excludeFromRecents="true" . 在manifest.xml中,A和B通过android:excludeFromRecents="true"

A=Main Activity (secured)
B=Base activity (secured)
C=Extra activity (Less secured)

But, I want to show how many times the Activity C has appeared in recent launches in the app. 但是,我想展示Activity C在应用程序的最新发布中出现了多少次。

Please guide me. 请指导我。

I think what you need to do is add the FLAG_ACTIVITY_NEW_TASK flag when launching Activity C or some variation of that flag. 我认为您需要做的是在启动活动C或该标志的某些变体时添加FLAG_ACTIVITY_NEW_TASK标志。

You can read some more on different ways of launching activities here 您可以在此处阅读有关启动活动的不同方式的更多信息

example: 例:

Intent i = new Intent(this, AcitivityC.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM