简体   繁体   中英

How to separate Service and Activity in Android MVP architecture?

I am working on Android Music-Player. I am using Service to play songs, SQLite Database to store songs, and ContentProvider to access sqlite database. I am confused, how can I maintain connection between service and activity? Should I implement connection between presenter and Service? As I am planning to consider my Service as Model, what will be the best and easiest approach to do that?

看看这里描述的方法 - 它应该可以帮助您在 MVP 架构中将您的服务与您的活动分离。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM