NFC intent calling onPause before onNewIntent - How to know the origin of the onPause call?

Viewed 1375

While scanning an NFC tag in an application with Foreground Dispatch enabled, onPause() is called before onNewIntent(). Is it possible to get the NFC intent already in onPause() so that I can stop (or not) processes according to the origin of the intent?

Since the activity is in the foreground and should not be paused/resumed when a tag is scanned, and since I have tasks that have to stop or start in onPause/onResume, you can see the problem.

The getIntent().getAction() is always "MAIN", but surely there must be a way to get a more accurate description of the intent? Or is not possible to know it's an NFC intent before entering onNewIntent()?

1 Answers
Related