onServiceConnected() not called

前端 未结 7 1350
情书的邮戳
情书的邮戳 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:27

    This is what worked for me

    Instead of

    public IBinder onBind(Intent intent) {
        return null;
    }
    

    I used

    public IBinder onBind(Intent intent) {
        return mMessenger.getBinder();
    }
    

提交回复
热议问题