简体   繁体   English

NFC的TabActivity和onNewIntent

[英]TabActivity and onNewIntent for NFC

I am working on an application that implements a TabActivity with two different Activities. 我正在开发一个通过两个不同的Activity实现TabActivity的应用程序。

The application uses NFC and in order to manage the tag_discover I have the two methods onNewIntent and onResume . 该应用程序使用NFC,并且为了管理tag_discover我有两种方法onNewIntentonResume

When I open the interface and I use the first Activity everything works well, I am able to read a tag and do some action onNewIntent when the tag is read. 当我打开界面并使用第一个Activity时,一切正常,我能够读取标签并在读取标签后对onNewIntent进行一些操作。

When I switch to the second tab and I come back in the first Activity the application doesn't work correctly. 当我切换到第二个选项卡并返回到第一个活动时,该应用程序无法正常运行。 It seems that onNewIntent is not called. 似乎未调用onNewIntent

Any idea why? 知道为什么吗?

You need to enable the foreground dispatch system . 您需要启用前台调度系统 Please read the docs and also take a look to the API Demos example and the NFC one under your sdk/samples 请阅读文档,并查看sdk / samples下的API Demos示例和NFC示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM