onServiceConnected() not called

前端 未结 7 1405
情书的邮戳
情书的邮戳 2020-12-30 01:41

I have a problem with using a background service.
I am using the service from 2 activities.

The first activity starts the Service with start

7条回答
  •  情深已故
    2020-12-30 02:21

    In my case, it was because I had forgotten to instantiate the binder inside the service and so onBind returned null. I had this:

        private ServiceBinder mServiceBinder;
    

    instead of this:

        private ServiceBinder mServiceBinder = new ServiceBinder();
    

提交回复
热议问题