简体   繁体   中英

Android: activity managment and NFC Tag detector

I hope that someone can help me with this.

As you know when an NFC tag is detected automatically we have a window dialog that contains the list the application that we can use. To avoid this there is a way with pending event to intercept the tag and avoid the window dialog with the list.

My problem: I have a TabActivity with two activities. One of the two activities read a tag (we can call this activity as follow: " READ_ACTIVITY "). When a tag is detected I don't want change my screen, I want to stay in the same interface where I am before the interception of the tag. As I said it's possible to do it with the following code:

      mAdapter.enableForegroundDispatch(hereiam, intent, null, null);

where intent is a pendingIntent.

Now this foreground dispatch is done by READ_ACTIVITY . My problem is that when a tag is detect, the application open a new READ ACTIVITY, while I would like to stay in the tabactivity . Someone knows how to stay in the tabactivity when a tag is detected?

Thanks in advance

您需要设置要拦截的TechList以及intentFiltersArray,请遵循有关此文档以及NFC和API演示示例,这些示例已经实现了您想要的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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