怎么不显示的选项列表中打开一个意图,如果一个是机器人已经打开 [英] how to not show list of options to open an intent if one is already open in android

查看:115
本文介绍了怎么不显示的选项列表中打开一个意图,如果一个是机器人已经打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我显示我在时可用其触发获得NFC标签选项列表中的应用程序。 我不希望显示的选项,如果我的应用程序已经打开。 可能吗?怎么样?

I am showing my application in list of options available to get NFC tag when its trigger. I don't want to show the options if my application is already open. Is it possible? and how?

推荐答案

当您希望收到NFC的意图,而你的应用程序是在前台,您应该注册你的活动为<一个href="http://developer.android.com/guide/topics/connectivity/nfc/advanced-nfc.html#foreground-dispatch"相对=nofollow>前台调度系统。这样一来,你的活动获得precedence通过该登记在他们的应用程序清单相同的标签类型的其他应用程序。因此,当你活性的研究是在foregorund,没有任何活动选择器将显示,即使其他应用程序也有意图过滤器这些事件。

When you want to receive NFC intents while your app is in the foreground, you should register your activity for the foreground dispatch system. That way, your activity gets precedence over other apps that registered for the same tag type in their app manifest. Thus, while your acitivity is in the foregorund, no activity chooser will be shown even if another app also has intent filters for these events.

这篇关于怎么不显示的选项列表中打开一个意图,如果一个是机器人已经打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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