user1400708
user1400708

Reputation: 9

In Android, How can I consume NFC actions without having a foreground activity =

I'm trying to read a nfc tag in the background and then save the read message in a file. However, the only way i found is having an activity on top. I also tried with a service but the NfcAdapter cannot directly communicate with android services using ACTIONS.

Upvotes: 0

Views: 310

Answers (1)

NFC guy
NFC guy

Reputation: 10228

Only Activities can receive NFC intents. There is no way for a background task or a service to receive them. This is an intentional design choice, I think. It always gives the user full control, just like with the Android Beam screen that the user has to tap before any data is shared over NFC.

Upvotes: 1

Related Questions