如何使用我的意图添加标记清单文件我的、如何使用、意图、清单

2023-09-06 03:34:15 作者:σκ吣凊-蚚朌

我们知道,有标记,我们可以用addFlags()方法在我们的Java code加入到我们的意图。有没有什么办法,我们可以在清单文件本身添加Java中的code写这个的这些标志来代替。 我需要添加REORDER_TO_FRONT标志我的清单中的活动之一。

we know that there are flags which we can add to our intent using the addFlags() method in our java code. Is there any way we can add these flags in the manifest file itself instead of writing this in java code. I need to add REORDER_TO_FRONT flag for one of my activities in the manifest.

如何实现这一目标?

推荐答案

在清单文件中不能添加意向flags.You需要设置标志意图其中U传递给startActivity。下面是一个例子:

In manifest file you can not add Intent flags.You need to set the flag in Intent which u pass to startActivity. Here is a sample:

Intent intent = new Intent(this, ActivityNameToLaunch.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);