Taal

Activity.OnNewIntent Method

Definition

Overloads

Name Description
OnNewIntent(Intent)

This is called for activities that set launchMode to "singleTop" in their package, or if a client used the Intent.FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent).

OnNewIntent(Intent, ComponentCaller)

Same as onNewIntent(Intent), but with an extra parameter for the ComponentCaller instance associated with the app that sent the intent.

OnNewIntent(Intent)

This is called for activities that set launchMode to "singleTop" in their package, or if a client used the Intent.FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent).

[Android.Runtime.Register("onNewIntent", "(Landroid/content/Intent;)V", "GetOnNewIntent_Landroid_content_Intent_Handler")]
protected virtual void OnNewIntent(Android.Content.Intent? intent);
[<Android.Runtime.Register("onNewIntent", "(Landroid/content/Intent;)V", "GetOnNewIntent_Landroid_content_Intent_Handler")>]
abstract member OnNewIntent : Android.Content.Intent -> unit
override this.OnNewIntent : Android.Content.Intent -> unit

Parameters

intent
Intent

Intent: The new intent that was used to start the activity

Attributes

Remarks

This is called for activities that set launchMode to "singleTop" in their package, or if a client used the Intent.FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent). In either case, when the activity is re-launched while at the top of the activity stack instead of a new instance of the activity being started, onNewIntent() will be called on the existing instance with the Intent that was used to re-launch it. An activity can never receive a new intent in the resumed state. You can count on onResume() being called after this method, though not necessarily immediately after the completion of this callback. If the activity was resumed, it will be paused and new intent will be delivered, followed by onResume(). If the activity wasn't in the resumed state, then new intent can be delivered immediately, with onResume() called sometime later when activity becomes active again. Note that getIntent() still returns the original Intent. You can use setIntent(Intent) to update it to this new Intent.

See also:

Android reference for android.app.Activity.onNewIntent.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

OnNewIntent(Intent, ComponentCaller)

Same as onNewIntent(Intent), but with an extra parameter for the ComponentCaller instance associated with the app that sent the intent.

[Android.Runtime.Register("onNewIntent", "(Landroid/content/Intent;Landroid/app/ComponentCaller;)V", "GetOnNewIntent_Landroid_content_Intent_Landroid_app_ComponentCaller_Handler", ApiSince=35)]
public virtual void OnNewIntent(Android.Content.Intent intent, Android.App.ComponentCaller caller);
[<Android.Runtime.Register("onNewIntent", "(Landroid/content/Intent;Landroid/app/ComponentCaller;)V", "GetOnNewIntent_Landroid_content_Intent_Landroid_app_ComponentCaller_Handler", ApiSince=35)>]
abstract member OnNewIntent : Android.Content.Intent * Android.App.ComponentCaller -> unit
override this.OnNewIntent : Android.Content.Intent * Android.App.ComponentCaller -> unit

Parameters

intent
Intent

Intent: The new intent that was used to start the activity. This value cannot be null.

caller
ComponentCaller

ComponentCaller: The ComponentCaller instance associated with the app that sent the intent. This value cannot be null.

Attributes

Remarks

Same as onNewIntent(Intent), but with an extra parameter for the ComponentCaller instance associated with the app that sent the intent. If you want to retrieve the caller without overriding this method, call getCurrentCaller() inside your existing onNewIntent(Intent). Note that you should only override one onNewIntent(Intent) method.

See also:

Android reference for android.app.Activity.onNewIntent.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to