Skip to main content
Participating Frequently
January 22, 2013
Question

ANE Android override Activity onNewIntent()

  • January 22, 2013
  • 1 reply
  • 1302 views

Hi,

I'm trying to create an NFC extension to be informed when a Tag is detected by the NFC sensor.

I guess i have more or less everything i need, expect that onNewIntent override.

In the JAVA samples i saw, as soon as we call enableForegroundDispatch on the NfcAdapter, the onNewIntent() method of the activity specified on the enableForegroundDispatch is called.

We have access to the Activity via the FREContext.getActivity() so i can specify the activity that will get the onNewIntent called, but as i can't really extend the FREContext class, i can't override this method to catch the intent.

Is there any way to achieve this?

Have a nice day !

This topic has been closed for replies.

1 reply

Durss_oldAuthor
Participating Frequently
January 24, 2013

I found this solution that almost satisfies me :

http://forums.adobe.com/message/4491738?tstart=0#4491738

It's basically based on the fact that passing a tag in front on the NFC chips fires an InvokeEvent to the AIR's NativeApplication.

I'm just searching why i get only one of two tag IDs.

Even if i manually grab the last intent tag ID with the ANE i don't have the new tag but the previous one, until i pass the new tag a second time.

With a pure Java project overriding the onNewIntent as i wanted to do i have no problem. The onNewIntent() is called everytime a new tag is detected.

And for now, i have no idea what could be the source of my problem but i still search.

If anyone has an idea, i'll be glad to read it