ActivityOptions.AllowPassThroughOnTouchOutside Property

Definition

Returns whether the source activity allows the overlaying activities from the to-be-launched app to pass through touch events to it when touches fall outside the content window. -or- Sets whether the source activity allows the overlaying activities from the to-be-launched app to pass through touch events to it when touches fall outside the content window.

public virtual bool AllowPassThroughOnTouchOutside { [Android.Runtime.Register("isAllowPassThroughOnTouchOutside", "()Z", "GetIsAllowPassThroughOnTouchOutsideHandler", ApiSince=36)] get; [Android.Runtime.Register("setAllowPassThroughOnTouchOutside", "(Z)V", "GetSetAllowPassThroughOnTouchOutside_ZHandler", ApiSince=36)] set; }
[<get: Android.Runtime.Register("isAllowPassThroughOnTouchOutside", "()Z", "GetIsAllowPassThroughOnTouchOutsideHandler", ApiSince=36)>]
[<set: Android.Runtime.Register("setAllowPassThroughOnTouchOutside", "(Z)V", "GetSetAllowPassThroughOnTouchOutside_ZHandler", ApiSince=36)>]
member this.AllowPassThroughOnTouchOutside : bool with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Returns whether the source activity allows the overlaying activities from the to-be-launched app to pass through touch events to it when touches fall outside the content window.

Java documentation for android.app.ActivityOptions.isAllowPassThroughOnTouchOutside().

Property setter documentation:

Sets whether the source activity allows the overlaying activities from the to-be-launched app to pass through touch events to it when touches fall outside the content window.

By default, touches that fall on a translucent non-touchable area of an overlaying activity window may be blocked from passing through to the activity below (source activity), unless the overlaying activity is from the same UID as the source activity. The source activity may use this method to opt in and allow the overlaying activities from the to-be-launched app to pass through touches to itself. The source activity needs to ensure that it trusts the overlaying activity and its content is not vulnerable to UI redressing attacks. The flag is ignored if the context calling Context#startActivity(Intent, Bundle) is not an activity.

Apps with target SDK 36 and above that depend on cross-uid pass-through touches must opt in to ensure that pass-through touches work correctly.

For backward compatibility, apps with target SDK 35 and below may still receive pass-through touches without opt-in if the cross-uid activity is launched by the source activity.

Java documentation for android.app.ActivityOptions.setAllowPassThroughOnTouchOutside(boolean).

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