Language

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がスローされ、このメソッドがオーバーライドされ、テスト結果が提供されます。

属性

注釈

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象