Local Bound Service Remote Bound Service
摘要:
首先创建子类 BoundService 继承 Service; 在BoundService 中创建子类 MyBinder 继承 Binder; Binder的作用就是进程内或进程之间 service 和client 交互的媒介(我现在暂时这么认为), MyBinder 中 实现 getService()的方法, 返回当前BoundService; 在要使用Service的Activity中 使用bindService (); 此时,你需要创建一个 ServiceConnection 去连接Activity 和 Service 。 改写ServiceConnection的2个方法public . 阅读全文
posted @ 2014-02-11 14:49 小白说我是2B 阅读(203) 评论(0) 推荐(0) 编辑