View.ContentCaptureSession 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取用于通知内容捕获事件的会话。 - 或 - 设置与此视图关联的 (可选) ContentCaptureSession
。
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
属性值
会话显式设置, #setContentCaptureSession(ContentCaptureSession)
由上级继承,默认会话或 null
如果对此视图禁用内容捕获,则为 。
- 属性
注解
属性 getter 文档:
获取用于通知内容捕获事件的会话。
的 android.view.View.getContentCaptureSession()
Java 文档。
属性资源库文档:
设置与此视图关联的 (可选) ContentCaptureSession
。
如果需要将 关联 ContentCaptureContext
到与此视图关联的内容捕获事件或其视图层次结构 ((如果 ViewGroup
它是) )时,应调用此方法。
例如,如果活动与 Web 域相关联,则首先需要设置main DOM 的上下文:
ContentCaptureSession mainSession = rootView.getContentCaptureSession();
mainSession.setContentCaptureContext(ContentCaptureContext.forLocusId(Uri.parse(myUrl));
然后,如果页面有 , IFRAME
你将为其创建一个新会话:
ContentCaptureSession iframeSession = mainSession.createContentCaptureSession(
ContentCaptureContext.forLocusId(Uri.parse(iframeUrl)));
iframeView.setContentCaptureSession(iframeSession);
此页面的某些部分是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的条款使用。