Hallo Kev,

> However, when I return from the home screen I get the
> android.intent.action.MAIN action, which I think makes sense.

When you launch your app through the launcher screen you should receive
the intent action android.intent.action.MAIN with category
android.intent.category.LAUNCHER.

When your app is started by the NDEF discovery event, you should receive
an intent action android.nfc.action.NDEF_DISCOVERED.

For your foreground dispatch you should receive an intent action
android.nfc.action.NDEF_DISCOVERED (or an intent action
android.nfc.action.TECH_DISCOVERED).

> The OS has received an 'intent' from the NFC hardware, which one of my
> intent filters in the manifest matched, and then in order to launch my
> application uses the 'MAIN' action?

No. The intent starts the app, so the action will not be changed by the OS.

> Which is then what I receive in my onResume code.

This is where your error is. The onResume() method does not "receive"
any intent at all. Once an activity was started (i.e. once its
onCreate() method fired), the getIntent() method will return the same
intent until setIntent() is explicitly called from your code.

So to summarize this, onResume() might not be the place you want to
respond to intents.

For the initial intent that started your activity, the proper place
would be onCreate(). For any following intent, onNewIntent() may be the
proper place (as long as your activity meets the conditions for
onNewIntent() to be fired.)

br,
Michael

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to