Home

onNewIntentIntent

onNewIntentIntent is not a standard Android API name. The correct callback name is onNewIntent(Intent), a method of the Android Activity class. This article describes that method and clarifies how it is used when an activity already exists.

Overview

onNewIntent(Intent) is a lifecycle callback that is invoked when an existing instance of an activity receives

When it is called

onNewIntent(Intent) is typically triggered in scenarios involving activity launch modes or intent flags that route a

- If an activity is declared with launchMode="singleTop" and it is already at the top of the task

- If an activity uses launchMode="singleTask" or "singleInstance" and an existing task contains the activity, a new

Usage patterns

Within onNewIntent(Intent), developers commonly:

- Call super.onNewIntent(intent) to preserve default behavior.

- Update the activity’s internal state based on the new intent data.

- Optionally call setIntent(intent) to replace the current intent returned by getIntent() with the latest one.

- Refresh UI components or pass the new intent to fragments or other components as needed.

Relation to lifecycle

onNewIntent does not create a new activity; it complements the standard lifecycle by providing a mechanism

Related concepts

Launch modes (standard, singleTop, singleTask, singleInstance), intent flags, and data transmission via extras or data URIs

a
new
Intent.
It
is
not
called
during
the
initial
creation
of
the
activity
(that
occurs
via
onCreate).
The
method
provides
a
way
to
handle
new
data
or
actions
without
creating
a
new
activity
instance.
new
intent
to
an
existing
instance.
For
example:
stack,
a
new
intent
targets
the
same
instance
and
onNewIntent
is
called.
intent
is
delivered
through
onNewIntent
instead
of
creating
a
new
instance.
to
react
to
new
intents
without
restructuring
the
activity.
If
the
activity
needs
to
restart
its
setup
with
the
new
data,
developers
may
choose
to
handle
that
logic
within
onNewIntent
or
propagate
the
intent
to
child
components.
are
central
to
effectively
using
onNewIntent(Intent).