Service not being created (or connecting) after bindService()

后端 未结 3 812
南笙
南笙 2021-02-08 11:55

I have this simple service that broadcasts the current location of the user. I want to use the binding mechanism just to control the service life-cycle, but the service is just

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-08 12:23

    I had my Activity implement ServiceConnection and bound like this:

    bindService( new Intent( this, Service.class ), this, Context.BIND_AUTO_CREATE );
    

    Then handled the callbacks for onServiceConnected() and onServiceDisconnected() in my Activity

提交回复
热议问题