[英]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
我有两种方法onNewIntent
和onResume
。
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.