RemoteInput 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
RemoteInput
物件會指定要從使用者收集的輸入,以連同傳送之 內的 android.app.PendingIntent
意圖一起傳遞。
[Android.Runtime.Register("android/app/RemoteInput", DoNotGenerateAcw=true)]
public sealed class RemoteInput : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/app/RemoteInput", DoNotGenerateAcw=true)>]
type RemoteInput = class
inherit Object
interface IParcelable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- 繼承
- 屬性
- 實作
備註
RemoteInput
物件會指定要從使用者收集的輸入,以連同傳送之 內的 android.app.PendingIntent
意圖一起傳遞。 一律使用 RemoteInput.Builder
來建立這個類別的實例。 <p class=「note」 > 如需如何使用這個類別的詳細資訊,請參閱 回復通知 。
下列範例會將 新增 RemoteInput
至 Notification.Action
、將結果索引鍵設定為 quick_reply
,並將標籤設定為 Quick reply
。 當使用者觸發動作時,系統會提示使用者輸入回應。 結果會連同意圖一起傳送,而且可以使用結果索引鍵擷取, (從 所 #getResultsFromIntent
傳回的 Bundle) 提供給 Builder
建構函式。
public static final String KEY_QUICK_REPLY_TEXT = "quick_reply";
Notification.Action action = new Notification.Action.Builder(
R.drawable.reply, "Reply", actionIntent)
<b>.addRemoteInput(new RemoteInput.Builder(KEY_QUICK_REPLY_TEXT)
.setLabel("Quick reply").build()</b>)
.build();
android.app.PendingIntent
引發 時,內的意圖會在收集時包含輸入結果。 若要存取這些結果,請使用 函式 #getResultsFromIntent
。 結果值會顯示在傳遞至 Builder
建構函式的結果索引鍵底下。
public static final String KEY_QUICK_REPLY_TEXT = "quick_reply";
Bundle results = RemoteInput.getResultsFromIntent(intent);
if (results != null) {
CharSequence quickReplyResult = results.getCharSequence(KEY_QUICK_REPLY_TEXT);
}
的 android.app.RemoteInput
JAVA 檔。
此頁面的部分是根據所建立和共用的工作進行修改,並根據 2.5 屬性授權中所述的詞彙來使用。
欄位
EditChoicesBeforeSendingAuto |
已淘汰.
平臺會決定在傳送至應用程式之前,是否要編輯選擇。 |
EditChoicesBeforeSendingDisabled |
已淘汰.
點選選擇應該立即傳送輸入,而不需要讓使用者編輯。 |
EditChoicesBeforeSendingEnabled |
已淘汰.
點選選擇應該讓使用者在傳送至應用程式之前先編輯輸入。 |
ExtraResultsData |
額外新增至剪輯資料意圖物件,以保存文字結果組合。 |
ResultsClipLabel |
用來表示用於遠端輸入傳輸之剪輯資料類型的標籤 |
SourceChoice |
已淘汰.
使用者已從 |
SourceFreeFormInput |
已淘汰.
使用者手動輸入資料。 |
屬性
AllowedDataTypes |
取得可接受的非文字輸入。 |
AllowFreeFormInput |
取得使用者是否可以為輸入提供任意值。 |
Class |
傳回這個 |
Creator | |
EditChoicesBeforeSending |
取得點選選擇是否應該讓使用者在傳送至應用程式之前編輯輸入。 |
Extras |
取得隨此遠端輸入所攜帶的其他中繼資料。 |
Handle |
基礎 Android 實例的控制碼。 (繼承來源 Object) |
IsDataOnly |
如果輸入只接受資料,表示 |
JniIdentityHashCode |
|
JniPeerMembers |
|
Label |
|
LabelFormatted |
收集此輸入時,取得要向使用者顯示的標籤。 |
PeerReference |
|
ResultKey |
從傳送 時 |
ThresholdClass |
此 API 支援適用于 Android 的 Mono 基礎結構,並不適合直接從您的程式碼使用。 (繼承來源 Object) |
ThresholdType |
此 API 支援適用于 Android 的 Mono 基礎結構,並不適合直接從您的程式碼使用。 (繼承來源 Object) |
方法
AddDataResultToIntent(RemoteInput, Intent, IDictionary<String,Uri>) |
與 |
AddResultsToIntent(RemoteInput[], Intent, Bundle) |
在意圖物件中填入從遠端輸入收集的文字結果。 |
Clone() |
建立並傳回這個 物件的複本。 (繼承來源 Object) |
DescribeContents() |
描述這個可封送處理標記法中包含的特殊物件種類。 |
Dispose() |
|
Dispose(Boolean) |
|
Equals(Object) |
指出其他物件是否「等於」這個物件。 (繼承來源 Object) |
GetChoices() |
取得可能的輸入選項。 |
GetChoicesFormatted() |
取得可能的輸入選項。 |
GetDataResultsFromIntent(Intent, String) |
類似于 |
GetHashCode() |
傳回此物件的雜湊碼值。 (繼承來源 Object) |
GetResultsFromIntent(Intent) |
從意圖取得遠端輸入文字結果組合。 |
GetResultsSource(Intent) |
取得 RemoteInput 結果的來源。 |
JavaFinalize() |
當垃圾收集判斷物件不再參考物件時,垃圾收集行程會在物件上呼叫。 (繼承來源 Object) |
Notify() |
喚醒正在等候此物件監視器的單一線程。 (繼承來源 Object) |
NotifyAll() |
喚醒正在等候此物件監視器的所有線程。 (繼承來源 Object) |
SetHandle(IntPtr, JniHandleOwnership) |
設定 Handle 屬性。 (繼承來源 Object) |
SetResultsSource(Intent, RemoteInputSource) |
設定 RemoteInput 結果的來源。 |
ToArray<T>() |
|
ToString() |
傳回物件的字串表示。 (繼承來源 Object) |
UnregisterFromRuntime() |
|
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() |
|
IJavaPeerable.DisposeUnlessReferenced() |
|
IJavaPeerable.Finalized() |
|
IJavaPeerable.JniManagedPeerState |
|
IJavaPeerable.SetJniIdentityHashCode(Int32) |
|
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
|
IJavaPeerable.SetPeerReference(JniObjectReference) |
|
擴充方法
JavaCast<TResult>(IJavaObject) |
執行 Android 執行時間檢查的類型轉換。 |
JavaCast<TResult>(IJavaObject) |
|
GetJniTypeName(IJavaPeerable) |
|