MediaSession.SetMediaButtonReceiver(PendingIntent) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為媒體按鈕接收器設定待處理意圖,允許在會話結束後重新播放。
[Android.Runtime.Register("setMediaButtonReceiver", "(Landroid/app/PendingIntent;)V", "")]
public void SetMediaButtonReceiver(Android.App.PendingIntent? mbr);
[<Android.Runtime.Register("setMediaButtonReceiver", "(Landroid/app/PendingIntent;)V", "")>]
member this.SetMediaButtonReceiver : Android.App.PendingIntent -> unit
參數
- mbr
- PendingIntent
PendingIntent傳送媒體按鈕事件。
- 屬性
備註
為媒體按鈕接收器設定待處理意圖,允許在會話結束後重新播放。
如果你的應用程式是以這種 Intent#ACTION_MEDIA_BUTTON 方式啟動,意圖會透過待處理意圖傳送。
所提供的 PendingIntent 不得針對某項活動。 在針對 Android V 及以上的應用程式中,將待定意圖傳遞給此方法會產生 IllegalArgumentException。 在針對 Android U 以下的應用程式中,通過「待定意圖」的活動會導致該通話被忽略。 如需詳細資訊請參閱此指南。
建議 pending intent 明確表示,以遵循 的安全 PendingIntent#getService建議。
此會員已被棄用。 請改用 #setMediaButtonBroadcastReceiver(ComponentName)。
Java 文件 android.media.session.MediaSession.setMediaButtonReceiver(android.app.PendingIntent)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。