語言

View.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 是此視圖中是否關閉內容擷取。

屬性

備註

財產取得者文件:

取得用來通知內容擷取事件的會話。

的 android.view.View.getContentCaptureSession()Java 檔。

屬性設定文件:

設定與此視圖相關的(可選性)。 ContentCaptureSession

當你需要將 a ContentCaptureContext 關聯到與此視圖或其視圖階層相關的內容擷取事件(如果是 ViewGroup)時,應該呼叫這個方法。

舉例來說,如果你的活動與某個網域相關聯,首先你需要為主 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);

的 android.view.View.setContentCaptureSession(android.view.contentcapture.ContentCaptureSession)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於