2011年6月1日水曜日

context.stopService

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 ServiceConnection objects bound to it with the BIND_AUTO_CREATE set, it will not be destroyed until all of these bindings are removed. See the Service documentation for more details on a service's lifecycle.

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

Parameters

service

Description of the service to be stopped. The Intent may specify either an explicit component name to start, or a logical description (action, category, etc) to match an IntentFilter published by a service.

Returns
  • If there is a service matching the given Intent that is already running, then it is stopped and true is returned; else false is returned.
Throws

 

SecurityException

 

0 件のコメント:

コメントを投稿