On a project I\'m working on I\'ve come across an issue with receiving external intents, i.e. non-launcher intents. I have an Activity
that can be started using the
Add android:launchMode="singleTop"
to the
description.
When the Activity is launched (if it isn't already running), Android will call onCreate()
and you can get the Intent
by calling getIntent()
(like you are already doing).
If the Activity is launched while your app is already running, Android will bring it to the foreground and will call onNewIntent()
passing in the new Intent
. You should override this method and do something with the passed Intent
(save it in a member variable or extract what you want from it or whatever). After that Android will call onResume()
.
Calling getIntent()
will ALWAYS return the Intent
that was used to originally start the Activity.