Android.Content.Context.StopService Method
Request that a given application service be stopped.

Syntax

[Android.Runtime.Register("stopService", "(Landroid/content/Intent;)Z", "GetStopService_Landroid_content_Intent_Handler")]
public abstract bool StopService (Intent service)

See Also

Context.StartService(Intent)

Parameters

service
Description of the service to be stopped. The Intent must be either fully explicit (supplying a component name) or specify a specific package name it is targetted to.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.SecurityException 

Remarks

Request that a given application service be stopped. If the service is not running, nothing happens. Otherwise it is stopped. Note that calls to startService() are not counted -- this stops the service no matter how many times it was started.

Note that if a stopped service still has Android.Content.IServiceConnection objects bound to it with the Context.BIND_AUTO_CREATE set, it will not be destroyed until all of these bindings are removed. See the Android.App.Service documentation for more details on a service's lifecycle.

This function will throw Java.Lang.SecurityException if you do not have permission to stop the given service.

[Android Documentation]

Requirements

Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1