Udostępnij za pośrednictwem


Activity.SetRecentsScreenshotEnabled(Boolean) Method

Definition

If set to false, this indicates to the system that it should never take a screenshot of the activity to be used as a representation in recents screen.

[Android.Runtime.Register("setRecentsScreenshotEnabled", "(Z)V", "GetSetRecentsScreenshotEnabled_ZHandler", ApiSince=33)]
public virtual void SetRecentsScreenshotEnabled (bool enabled);
[<Android.Runtime.Register("setRecentsScreenshotEnabled", "(Z)V", "GetSetRecentsScreenshotEnabled_ZHandler", ApiSince=33)>]
abstract member SetRecentsScreenshotEnabled : bool -> unit
override this.SetRecentsScreenshotEnabled : bool -> unit

Parameters

enabled
Boolean

true to enable recents screenshots; false otherwise.

Attributes

Remarks

If set to false, this indicates to the system that it should never take a screenshot of the activity to be used as a representation in recents screen. By default, this value is true.

Note that the system may use the window background of the theme instead to represent the window when it is not running.

Also note that in comparison to android.view.WindowManager.LayoutParams#FLAG_SECURE, this only affects the behavior when the activity's screenshot would be used as a representation when the activity is not in a started state, i.e. in Overview. The system may still take screenshots of the activity in other contexts; for example, when the user takes a screenshot of the entire screen, or when the active android.service.voice.VoiceInteractionService requests a screenshot via android.service.voice.VoiceInteractionSession#SHOW_WITH_SCREENSHOT.

Java documentation for android.app.Activity.setRecentsScreenshotEnabled(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