Partager via


View.ContentCaptureSession Property

Definition

Gets the session used to notify content capture events. -or- Sets the (optional) ContentCaptureSession associated with this view.

public Android.Views.ContentCaptures.ContentCaptureSession? ContentCaptureSession { [Android.Runtime.Register("getContentCaptureSession", "()Landroid/view/contentcapture/ContentCaptureSession;", "", ApiSince=29)] get; [Android.Runtime.Register("setContentCaptureSession", "(Landroid/view/contentcapture/ContentCaptureSession;)V", "GetSetContentCaptureSession_Landroid_view_contentcapture_ContentCaptureSession_Handler", ApiSince=29)] set; }
[<get: Android.Runtime.Register("getContentCaptureSession", "()Landroid/view/contentcapture/ContentCaptureSession;", "", ApiSince=29)>]
[<set: Android.Runtime.Register("setContentCaptureSession", "(Landroid/view/contentcapture/ContentCaptureSession;)V", "GetSetContentCaptureSession_Landroid_view_contentcapture_ContentCaptureSession_Handler", ApiSince=29)>]
member this.ContentCaptureSession : Android.Views.ContentCaptures.ContentCaptureSession with get, set

Property Value

session explicitly set by #setContentCaptureSession(ContentCaptureSession), inherited by ancestors, default session or null if content capture is disabled for this view.

Attributes

Remarks

Property getter documentation:

Gets the session used to notify content capture events.

Java documentation for android.view.View.getContentCaptureSession().

Property setter documentation:

Sets the (optional) ContentCaptureSession associated with this view.

This method should be called when you need to associate a ContentCaptureContext to the content capture events associated with this view or its view hierarchy (if it's a ViewGroup).

For example, if your activity is associated with a web domain, first you would need to set the context for the main DOM:

ContentCaptureSession mainSession = rootView.getContentCaptureSession();
              mainSession.setContentCaptureContext(ContentCaptureContext.forLocusId(Uri.parse(myUrl));

Then if the page had an IFRAME, you would create a new session for it:

ContentCaptureSession iframeSession = mainSession.createContentCaptureSession(
                  ContentCaptureContext.forLocusId(Uri.parse(iframeUrl)));
              iframeView.setContentCaptureSession(iframeSession);

Java documentation for android.view.View.setContentCaptureSession(android.view.contentcapture.ContentCaptureSession).

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