Share via


ActivityOptions.ModeBackgroundActivityStartAllowAlways Field

Definition

Caution

This constant will be removed in the future version. Use Android.App.BackgroundActivityStartMode enum directly instead of this field.

Grants the PendingIntent all background activity start privileges, including those normally reserved for privileged contexts (e.

[Android.Runtime.Register("MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS", ApiSince=36)]
[System.Obsolete("This constant will be removed in the future version. Use Android.App.BackgroundActivityStartMode enum directly instead of this field.", true)]
public const Android.App.BackgroundActivityStartMode ModeBackgroundActivityStartAllowAlways = 3;
[<Android.Runtime.Register("MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS", ApiSince=36)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.App.BackgroundActivityStartMode enum directly instead of this field.", true)>]
val mutable ModeBackgroundActivityStartAllowAlways : Android.App.BackgroundActivityStartMode

Field Value

Value = 3
Attributes

Remarks

Grants the PendingIntent all background activity start privileges, including those normally reserved for privileged contexts (e.g., companion apps or those with the START_ACTIVITIES_FROM_BACKGROUND permission).

<b>Caution:</b> This mode should be used sparingly. Most apps should use #MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE instead, relying on notifications or foreground services for background interactions to minimize user disruption. However, this mode is necessary for specific use cases, such as companion apps responding to prompts from a connected device.

For more information on background activity start restrictions, see: Restrictions on starting activities from the background

Java documentation for android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS.

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