如何使用我的意图添加标记清单文件 [英] How to add flags with my intent in the manifest file

查看:163
本文介绍了如何使用我的意图添加标记清单文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道,有标记,我们可以用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);

这篇关于如何使用我的意图添加标记清单文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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