Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addNdefListener not calling callback on first attempt #218

Closed
wants to merge 1 commit into from
Closed

addNdefListener not calling callback on first attempt #218

wants to merge 1 commit into from

Conversation

homer-jay
Copy link
Contributor

FIX for issue 217: addNdefListener not calling callback on first attempt

I don't know why the Intent contains the ACTION_NDEF_DISCOVERED when reading non-MIME NDEF records the first time.
After the first read, the action contains the ACTION_TECH_DISCOVERED as expected.

Even if this behavior were not the plugin's fault, it does make sense to fire the "ndef" event when reading MIME records in adition to the "ndef-mime" event, because if we have registered a callback with addNdefListener, then we want to be called back on every subtype of NDEF record.

FIX for issue 217: addNdefListener not calling callback on first attempt

I don't know why the Intent contains the ACTION_NDEF_DISCOVERED when reading non-MIME NDEF records the first time.
After the first read, the action contains the  ACTION_TECH_DISCOVERED as expected.

Even if this behavior were not the plugin's fault, it does make sense to fire the "ndef" event when reading MIME records in adition to the "ndef-mime" event, because if we have registered a callback with `addNdefListener`, then we want to be called back on every subtype of NDEF record.
@Segfaultd
Copy link

Can this pull request be merged please, this is really an annoying bug.. Thx!

@don
Copy link
Member

don commented Jun 1, 2018

This fixes the symptom but causes 2 events to be fired causing problems when an app uses both addNdefListener and addMimeTypeListener. I think I've tracked this problem down. See #217 (comment) for more details.

@don
Copy link
Member

don commented Jun 1, 2018

Thanks for the pull request. I'm closing this because the problem is fixed by #324

@don don closed this Jun 1, 2018
@homer-jay homer-jay deleted the patch-1 branch June 14, 2018 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants