Sdílet prostřednictvím


Activity.OnProvideAssistContent(AssistContent) Method

Definition

This is called when the user is requesting an assist, to provide references to content related to the current activity.

[Android.Runtime.Register("onProvideAssistContent", "(Landroid/app/assist/AssistContent;)V", "GetOnProvideAssistContent_Landroid_app_assist_AssistContent_Handler", ApiSince=23)]
public virtual void OnProvideAssistContent (Android.App.Assist.AssistContent? outContent);
[<Android.Runtime.Register("onProvideAssistContent", "(Landroid/app/assist/AssistContent;)V", "GetOnProvideAssistContent_Landroid_app_assist_AssistContent_Handler", ApiSince=23)>]
abstract member OnProvideAssistContent : Android.App.Assist.AssistContent -> unit
override this.OnProvideAssistContent : Android.App.Assist.AssistContent -> unit

Parameters

outContent
AssistContent

The assist content to return.

Attributes

Remarks

This is called when the user is requesting an assist, to provide references to content related to the current activity. Before being called, the outContent Intent is filled with the base Intent of the activity (the Intent returned by #getIntent()). The Intent's extras are stripped of any types that are not valid for PersistableBundle or non-framework Parcelables, and the flags Intent#FLAG_GRANT_WRITE_URI_PERMISSION and Intent#FLAG_GRANT_PERSISTABLE_URI_PERMISSION are cleared from the Intent.

Custom implementation may adjust the content intent to better reflect the top-level context of the activity, and fill in its ClipData with additional content of interest that the user is currently viewing. For example, an image gallery application that has launched in to an activity allowing the user to swipe through pictures should modify the intent to reference the current image they are looking it; such an application when showing a list of pictures should add a ClipData that has references to all of the pictures currently visible on screen.

Java documentation for android.app.Activity.onProvideAssistContent(android.app.assist.AssistContent).

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