onServiceConnected never called after bindService method

后端 未结 12 679
醉话见心
醉话见心 2020-11-30 05:48

I have a particular situation: a service started by a broadcast receiver starts an activity. I want to make it possible for this activity to communicate back to the service.

12条回答
  •  星月不相逢
    2020-11-30 06:03

    One more thing is that if you are calling bindservice method inside the oncreate method then the onserviceconnected is called after the oncreate method is finished.

    So any references to the interface functions before the oncreate ends (or before onserviceconnected is called) shows null pointer exception.

提交回复
热议问题