Service一直存在并且能调用服务里面的方法

    /**
     * 希望一个服务一直存在,并且能够调用服务里面的方法。
     * 启动服务
     * 先通过startService()的方式来启动服务,再通过onBind()的方式去绑定服务。
     * 
     * onCreate() --> onStart() -->onBind()
     * 
     * 
     * 停止服务:
     * 1: 先unbindService()来解绑服务,再通过stopService()来停止服务
     * onUnbind() ---> onDestory()
     * 
     * 2:先stopService()来停止服务,再通过unbindService()来解绑服务
     * 
     * onUnbind() ---> onDestory()
     * 
     * 
     * 通过startService()方式启动的服务,必须通过调用stopService()才能停止服务。
     * 如果服务还有绑定对象,那么一个服务是不会被停止的。
     * 
     * 
     * 怎么去调用服务里面方法。1 必须通过bindService()才能和服务进行通讯。打开了一个ServiceConnection连接。服务给我们返回了一个IBinder对象
     */
原文地址:https://www.cnblogs.com/androidez/p/2923410.html