android ApiDemo学习(一)service——6 Remote Service Controller

来源:互联网 发布:程序员加薪申请 编辑:程序博客网 时间:2024/06/05 11:50

可参考:http://blog.csdn.net/mapdigit/article/details/7711561

 

与local service controller一样,remote service controller使用start模式,而不是bind模式

使用startService启动服务,使用stopService停止服务。参数都是intent。

 

注意:

1 在remote service controller中点击start 之后,返回,服务并没有停止。此时再点击remote service binding,显示的计数就不是从1开始了。原因是这两个进程连接的是同一个service。controller启动service后,service中的service已经开始计数了。

2 在controller中点击start,service调用onCreate;返回,在binding中点击bind,service调用onBind;binding中点击onbind,service不会死掉;controller中点击stop,service才会onDestroy。

 

 

原创粉丝点击