Can bindService() be made to block?

前端 未结 4 889
鱼传尺愫
鱼传尺愫 2021-02-13 15:44

I have an Android application that uses a Remote Service and I bind to it with bindService(), which is asynchronous.

The app is useless until the service is

4条回答
  •  伪装坚强ぢ
    2021-02-13 16:04

    You cannot have bindService() block. However, your ServiceConnection (2nd parameter to bindService) has callbacks to tell you when the service is connected and disconnected, so you can have other code block until your onServiceConnected() method unblocks it.

提交回复
热议问题