Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Android 中,给定一个特定的Service,有多少种方法可以Service与其他组件(活动、内容提供者、接收者、其他服务)进行通信?
Service
据我所知,至少有7种方法:
还有其他人吗?
谢谢。
就像gunar所说,您也可以使用Event Bus。
最受欢迎的是:
文档是不言自明的,但如果您需要帮助才能开始,请告诉我。
问候, 瑞安
如果你想对它们进行分类,那么我会按照以下方式进行。
使用 Intent 进行通信
进程间通信(IPC),也可以用于进程内。
通过共享对象进行通信。