Context.SendStickyBroadcast 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| SendStickyBroadcast(Intent) |
已淘汰.
執行 |
| SendStickyBroadcast(Intent, Bundle) |
執行 |
SendStickyBroadcast(Intent)
警告
deprecated
執行 #sendBroadcast(Intent) 一個「黏性」的行為,意即你傳送的意圖會在廣播完成後仍保留,讓其他人能透過回傳值 #registerReceiver(BroadcastReceiver, IntentFilter)快速取得該資料。
[Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Handler")]
[Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")]
[System.Obsolete("deprecated")]
public abstract void SendStickyBroadcast(Android.Content.Intent? intent);
[<Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")>]
[<System.Obsolete("deprecated")>]
abstract member SendStickyBroadcast : Android.Content.Intent -> unit
參數
- intent
- Intent
廣播意圖;所有符合此意圖的接收器將接收該訊號,且意圖將被認定為重新廣播給未來的接收器。
- 屬性
備註
執行 #sendBroadcast(Intent) 一個「黏性」的行為,意即你傳送的意圖會在廣播完成後仍保留,讓其他人能透過回傳值 #registerReceiver(BroadcastReceiver, IntentFilter)快速取得該資料。 在其他所有方面,這的行為與 相同 #sendBroadcast(Intent)。
此會員已被棄用。 不應該使用置頂直播。 它們沒有安全性(任何人都能存取)、沒有保護(任何人都可以修改),還有許多其他問題。 建議的模式是使用非黏性廣播來回報 <em>某件事<或 em> 有變動,並有另一個機制讓應用程式隨時取得當前值。
Java 文件 android.content.Context.sendStickyBroadcast(android.content.Intent)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
另請參閱
- SendBroadcast(Intent)
- <xref:Android.Content.Context.SendStickyOrderedBroadcast(Android.Content.Intent%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver)>
適用於
SendStickyBroadcast(Intent, Bundle)
執行 #sendBroadcast(Intent) 一個「黏性」的行為,意即你傳送的意圖會在廣播完成後仍保留,讓其他人能透過回傳值 #registerReceiver(BroadcastReceiver, IntentFilter)快速取得該資料。
[Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;Landroid/os/Bundle;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Landroid_os_Bundle_Handler", ApiSince=31)]
[Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")]
public virtual void SendStickyBroadcast(Android.Content.Intent intent, Android.OS.Bundle? options);
[<Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;Landroid/os/Bundle;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Landroid_os_Bundle_Handler", ApiSince=31)>]
[<Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")>]
abstract member SendStickyBroadcast : Android.Content.Intent * Android.OS.Bundle -> unit
override this.SendStickyBroadcast : Android.Content.Intent * Android.OS.Bundle -> unit
參數
- intent
- Intent
廣播意圖;所有符合此意圖的接收器將接收該訊號,且意圖將被認定為重新廣播給未來的接收器。
- options
- Bundle
(可選)額外的傳送選項,由 android.app.BroadcastOptions.
- 屬性
備註
執行 #sendBroadcast(Intent) 一個「黏性」的行為,意即你傳送的意圖會在廣播完成後仍保留,讓其他人能透過回傳值 #registerReceiver(BroadcastReceiver, IntentFilter)快速取得該資料。 在其他所有方面,這的行為與 相同 #sendBroadcast(Intent)。
此會員已被棄用。 不應該使用置頂直播。 它們沒有安全性(任何人都能存取)、沒有保護(任何人都可以修改),還有許多其他問題。 建議的模式是使用非黏性廣播來回報 <em>某件事<或 em> 有變動,並有另一個機制讓應用程式隨時取得當前值。
Java 文件 android.content.Context.sendStickyBroadcast(android.content.Intent, android.os.Bundle)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。