How to bind two Android Activities to one Service?

前端 未结 3 1075
-上瘾入骨i
-上瘾入骨i 2021-02-06 00:21

I would like to ask for some example, where two different activities (button in first activity open second activity), are communicating with one service (AIDL, etc.) I\'ve tried

3条回答
  •  灰色年华
    2021-02-06 00:56

    Each Activity is responsible for binding and unbinding from the Service. This is normally done in onResume / onPause, or onStart / onStop, depending on your requirements. One Activity cannot bind another Activity to a Service. That's just the way it is. :)

提交回复
热议问题