This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

Similar to #startService(Intent) , but with an implicit promise that the Service will call android.app.Service#startForeground(int, android.app.Notification) startForeground(int, android.app.Notification) once it begins running.

[Android.Runtime.Register("startForegroundService", "(Landroid/content/Intent;)Landroid/content/ComponentName;", "GetStartForegroundService_Landroid_content_Intent_Handler", ApiSince=26)]
public abstract 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)>]
abstract member StartForegroundService : Android.Content.Intent -> Android.Content.ComponentName

Parameters

Identifies the service to be started. The Intent must be fully explicit (supplying a component name). Additional values may be included in the Intent extras to supply arguments along with this specific start call.

Returns

If the service is being started or is already running, the ComponentName of the actual service that was started is returned; else if the service does not exist null is returned.

Attributes
RegisterAttribute