語言

MockContext.StartForegroundService(Intent) 方法

定義

拋出 UnsupportedOperationException。 在測試中,可以覆寫此方法以啟動前景服務。

[Android.Runtime.Register("startForegroundService", "(Landroid/content/Intent;)Landroid/content/ComponentName;", "GetStartForegroundService_Landroid_content_Intent_Handler", ApiSince=26)]
public override Android.Content.ComponentName? StartForegroundService(Android.Content.Intent? service);
[<Android.Runtime.Register("startForegroundService", "(Landroid/content/Intent;)Landroid/content/ComponentName;", "GetStartForegroundService_Landroid_content_Intent_Handler", ApiSince=26)>]
override this.StartForegroundService : Android.Content.Intent -> Android.Content.ComponentName

參數

service
Intent

識別服務的意圖。 可進行測試覆寫;預設的模擬實作並未使用此參數。

傳回

沒有任何價值回傳。 預設的模擬實作拋 UnsupportedOperationException出 ;覆寫此方法以提供測試結果。

屬性

備註

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於