美文网首页
service小问题

service小问题

作者: heiheiwanne | 来源:发表于2016-08-24 11:03 被阅读8次

1.bundService 相当于将service中的一个int型size大小++,startService即将service中的一个boolean变量置为true

* bundService         intSize++
* startService          isStart=true

相反的

* unbundService   intSize--
* stopService/stopself isStart=false

只有intSize==0 && isStart ==false 同时满足时service才被干掉,否则不会消亡(这里注意多次unbundService ,intSize <0时会崩溃)

相关文章

网友评论

      本文标题:service小问题

      本文链接:https://www.haomeiwen.com/subject/fvansttx.html