禁用的Android梁评选活动 [英] Disable Android Beam for selected activities
问题描述
我和NFC Android上的合作,特别是通过Android Beam。我的问题是:是否有可能禁用活动Android Beam的支持
I'm working with NFC on Android, specifically with Android Beam. My question is: is it possible to disable Android Beam support for an activity?
这是一些系统应用程序做的,如消息:如果另一部手机放在靠近,我的手机振动但触摸梁屏幕不出现和其他手机没有收到任何东西。
This is what some system applications do, such as messaging: if another phone is put close, my phone vibrates but the "Touch to beam" screen doesn't appear and the other phone doesn't receive anything.
编辑:呼叫:
NfcAdapter.setNdefPushMessage(NdefMessage message, Activity activity, Activity... activities)
在 onResume()
与空
消息应该做的伎俩(该医生说:传递一个空NDEF消息中指定的活动禁用前景NDEF推。),但它不工作
in onResume()
with a null
message should do the trick (the doc says: "Pass a null NDEF message to disable foreground NDEF push in the specified activities.") but it doesn't work.
感谢
推荐答案
当我像这样做,它的工作原理就像一个魅力。
When I do it like this, It works like a charm.
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this);
adapter.setNdefPushMessage(null, this, this);
这篇关于禁用的Android梁评选活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!