Notification.Builder.SetSound 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| SetSound(Uri) |
此方法在 API 等級 26 中被淘汰。 |
| SetSound(Uri, AudioAttributes) |
此方法在 API 等級 26 中被淘汰。 |
| SetSound(Uri, Stream) |
已淘汰.
此方法在 API 等級 21 中被棄用。 |
SetSound(Uri)
此方法在 API 等級 26 中被淘汰。
[Android.Runtime.Register("setSound", "(Landroid/net/Uri;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Handler")]
public virtual Android.App.Notification.Builder? SetSound(Android.Net.Uri? sound);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Handler")>]
abstract member SetSound : Android.Net.Uri -> Android.App.Notification.Builder
override this.SetSound : Android.Net.Uri -> Android.App.Notification.Builder
參數
- sound
- Uri
Uri
傳回
這個 Android.App.Notification.Builder 實例,允許通話串接。
- 屬性
備註
此方法在 API 等級 26 中被淘汰。 改用 NotificationChannel.setSound(Uri,AudioAttributes)。
設定音效播放。 播放時會使用預設的通知音效屬性。
Android 參考資料。android.app.Notification.Builder.setSound
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetSound(Uri, AudioAttributes)
此方法在 API 等級 26 中被淘汰。
[Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Landroid_media_AudioAttributes_Handler")]
public virtual Android.App.Notification.Builder? SetSound(Android.Net.Uri? sound, Android.Media.AudioAttributes? audioAttributes);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Landroid_media_AudioAttributes_Handler")>]
abstract member SetSound : Android.Net.Uri * Android.Media.AudioAttributes -> Android.App.Notification.Builder
override this.SetSound : Android.Net.Uri * Android.Media.AudioAttributes -> Android.App.Notification.Builder
參數
- sound
- Uri
Uri
- audioAttributes
- AudioAttributes
音效屬性
傳回
這個 Android.App.Notification.Builder 實例,允許通話串接。
- 屬性
備註
此方法在 API 等級 26 中被淘汰。 改用 NotificationChannel.setSound(Uri,AudioAttributes)。
設定播放音效,並設定播放時要使用的特定音訊屬性。
另請參閱:
Android 參考資料。android.app.Notification.Builder.setSound
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
SetSound(Uri, Stream)
警告
deprecated
此方法在 API 等級 21 中被棄用。
[Android.Runtime.Register("setSound", "(Landroid/net/Uri;I)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_IHandler")]
[System.Obsolete("deprecated")]
public virtual Android.App.Notification.Builder? SetSound(Android.Net.Uri? sound, Android.Media.Stream streamType);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;I)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_IHandler")>]
[<System.Obsolete("deprecated")>]
abstract member SetSound : Android.Net.Uri * Android.Media.Stream -> Android.App.Notification.Builder
override this.SetSound : Android.Net.Uri * Android.Media.Stream -> Android.App.Notification.Builder
參數
- sound
- Uri
Uri
- streamType
- Stream
int
傳回
這個 Android.App.Notification.Builder 實例,允許通話串接。
- 屬性
備註
此方法在 API 等級 21 中被棄用。 使用 NotificationChannel.setSound(Uri,AudioAttributes)。
設定播放音效,並設定特定的串流播放。 請參考 AudioManager 來了解STREAM_常數。
Android 參考資料。android.app.Notification.Builder.setSound
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。