Język

MockContext.StartForegroundService(Intent) Method

Definition

Throws UnsupportedOperationException. Override this method to start a foreground service in a test.

[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

Parameters

service
Intent

The intent that identifies the service. Available to a test override; the default mock implementation does not use this argument.

Returns

No value is returned. The default mock implementation throws UnsupportedOperationException; override this method to supply a test result.

Attributes

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to