So I have a MapActivity that runs an asynchtask that occasionally updates what exactly it\'s displaying on the map (via a string). I originally pass this string in from the
When your activity flagged as singleTask
is already running and a new Intent
is sent to it, onNewIntent will be called to tell you about it.
By default, this new Intent does not get stored in any way after that call returns, and the default implementation does nothing. If you override onNewIntent
, you can process the extras attached to the new intent directly from there and/or use setIntent
to attach the new intent to your Activity so that future getIntent().get*Extra(...)
calls will return the updated data.
Note that there is one special case: if your singleTask
activity has launched another activity in its task (i.e. an embeddable activity without the NEW_TASK flag), that activity will come to the foreground when your activity receives an intent, but the intent itself will then be silently dropped. Be careful about that. See the Dev Guide for more info.