共用方式為


TextClassification 類別

定義

產生小工具以處理分類文字的資訊。

[Android.Runtime.Register("android/view/textclassifier/TextClassification", ApiSince=26, DoNotGenerateAcw=true)]
public sealed class TextClassification : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/textclassifier/TextClassification", ApiSince=26, DoNotGenerateAcw=true)>]
type TextClassification = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
繼承
TextClassification
屬性
實作

備註

產生小工具以處理分類文字的資訊。

TextClassification 物件包含圖示、標籤、onClickListeners和意圖,可用來建置可用於處理分類文字的小工具。 主要動作和其他次要動作的概念

例如,建置檢視,在按兩下時,會與慣用的應用程式共享分類文字:

{@code
              // Called preferably outside the UiThread.
              TextClassification classification = textClassifier.classifyText(allText, 10, 25);

              // Called on the UiThread.
              Button button = new Button(context);
              button.setCompoundDrawablesWithIntrinsicBounds(classification.getIcon(), null, null, null);
              button.setText(classification.getLabel());
              button.setOnClickListener(v -> classification.getActions().get(0).getActionIntent().send());
            }

例如,使用可以處理分類文字的功能表項來啟動動作模式:

{@code
              // Called preferably outside the UiThread.
              final TextClassification classification = textClassifier.classifyText(allText, 10, 25);

              // Called on the UiThread.
              view.startActionMode(new ActionMode.Callback() {

                  public boolean onCreateActionMode(ActionMode mode, Menu menu) {
                      for (int i = 0; i < classification.getActions().size(); ++i) {
                         RemoteAction action = classification.getActions().get(i);
                         menu.add(Menu.NONE, i, 20, action.getTitle())
                            .setIcon(action.getIcon());
                      }
                      return true;
                  }

                  public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
                      classification.getActions().get(item.getItemId()).getActionIntent().send();
                      return true;
                  }

                  ...
              });
            }

android.view.textclassifier.TextClassificationJava 檔。

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

屬性

Actions

傳回可在文字上執行的動作清單。

Class

傳回這個 Object的運行時間類別。

(繼承來源 Object)
Creator

產生小工具以處理分類文字的資訊。

EntityCount

傳回在分類文字中找到的實體數目。

Extras

傳回擴充的數據。

Handle

基礎Android實例的句柄。

(繼承來源 Object)
Icon

傳回可在用來處理分類文字的小工具上轉譯的圖示。

Id

傳回這個對象的標識碼,如果存在,則傳回標識符。

Intent

傳回可能引發以對分類文字採取行動的意圖。

JniIdentityHashCode

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
JniPeerMembers

產生小工具以處理分類文字的資訊。

Label

產生小工具以處理分類文字的資訊。

LabelFormatted

傳回可在用來處理分類文字之 Widget 上轉譯的標籤。

OnClickListener

會傳回可能觸發以處理分類文字的 OnClickListener。

PeerReference

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
Text

取得分類的文字。

ThresholdClass

此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。

(繼承來源 Object)
ThresholdType

此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。

(繼承來源 Object)

方法

Clone()

建立並傳回這個 對象的複本。

(繼承來源 Object)
DescribeContents()

產生小工具以處理分類文字的資訊。

Dispose()

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
Dispose(Boolean)

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
Equals(Object)

指出其他物件是否「等於」這個物件。

(繼承來源 Object)
GetConfidenceScore(String)

傳回指定實體的信賴分數。

GetEntity(Int32)

傳回位於指定索引處的實體。

GetHashCode()

傳回此物件的雜湊碼值。

(繼承來源 Object)
JavaFinalize()

當垃圾收集決定不再參考物件時,垃圾收集行程在 物件上呼叫。

(繼承來源 Object)
Notify()

喚醒正在等候此物件監視器的單一線程。

(繼承來源 Object)
NotifyAll()

喚醒正在等候此物件監視器的所有線程。

(繼承來源 Object)
SetHandle(IntPtr, JniHandleOwnership)

設定 Handle 屬性。

(繼承來源 Object)
ToArray<T>()

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
ToString()

傳回物件的字串表示。

(繼承來源 Object)
UnregisterFromRuntime()

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
Wait()

讓目前線程等候直到喚醒為止,通常是藉由em <notified/em>或<em>interrupted</em> 來喚醒它。<>

(繼承來源 Object)
Wait(Int64)

讓目前的線程等到喚醒為止,通常是因為 <em>notified</em> 或 <em>interrupted</em>,或直到經過一定數量的實時為止。

(繼承來源 Object)
Wait(Int64, Int32)

讓目前的線程等到喚醒為止,通常是因為 <em>notified</em> 或 <em>interrupted</em>,或直到經過一定數量的實時為止。

(繼承來源 Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

產生小工具以處理分類文字的資訊。

明確介面實作

IJavaPeerable.Disposed()

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
IJavaPeerable.DisposeUnlessReferenced()

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
IJavaPeerable.Finalized()

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
IJavaPeerable.JniManagedPeerState

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
IJavaPeerable.SetJniIdentityHashCode(Int32)

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

產生小工具以處理分類文字的資訊。

(繼承來源 Object)
IJavaPeerable.SetPeerReference(JniObjectReference)

產生小工具以處理分類文字的資訊。

(繼承來源 Object)

擴充方法

JavaCast<TResult>(IJavaObject)

執行 Android 執行時間檢查的類型轉換。

JavaCast<TResult>(IJavaObject)

產生小工具以處理分類文字的資訊。

GetJniTypeName(IJavaPeerable)

產生小工具以處理分類文字的資訊。

適用於