NFC Android wear (Huawei watch 2.0)

2020-07-30 02:29发布

问题:

I am new to Android Wear development (standalone application) and currently building an NFC reader for wear. The problem I am facing is with the function

adapter.enableForegroundDispatch(activity, pendingIntent, filters, techList)

Whenever I run my code it is throwing an "unsupported exception" in the onResume method. (The same piece of code works perfectly fine on the phone )

From what I have understood, in order to detect a tag the application needs to be in the foreground which is done by the above function. Since it is failing here, my pending intent is null and no tag is getting detected. Any information regarding this would be helpful.

标签: nfc wear-os