Disable Android Beam for selected activities

北战南征 提交于 2019-12-06 11:19:36

When I do it like this, It works like a charm.

NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this); 
adapter.setNdefPushMessage(null, this, this);

There isn't a way to do this currently. Maybe you can provide a menu option to disable NFC in your app? Why do you want to do this, by the way?

EDIT:

Sorry, there is a way to do this. Call setNdefPushMessage() in the activities that you don't want to push anything with a null NDEF message. Let me know if that works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!