ServiceUtils

class ServiceUtils
    author: Blankj
    blog  : http://blankj.com
    time  : 2016/08/02
    desc  : utils about service

Functions

bindService
Link copied to clipboard
open fun bindService(cls: Class<out Any>, conn: ServiceConnection, flags: Int)
Bind the service.
open fun bindService(className: String, conn: ServiceConnection, flags: Int)
Bind the service.
getAllRunningServices
Link copied to clipboard
open fun getAllRunningServices(): Set
Return all of the services are running.
isServiceRunning
Link copied to clipboard
open fun isServiceRunning(cls: Class<out Any>): Boolean
Return whether service is running.
open fun isServiceRunning(className: String): Boolean
Return whether service is running.
startService
Link copied to clipboard
open fun startService(cls: Class<out Any>)
Start the service.
open fun startService(className: String)
Start the service.
stopService
Link copied to clipboard
open fun stopService(cls: Class<out Any>): Boolean
Stop the service.
open fun stopService(className: String): Boolean
Stop the service.
unbindService
Link copied to clipboard
open fun unbindService(conn: ServiceConnection)
Unbind the service.