service小问题

2016-08-24  本文已影响8人  heiheiwanne

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时会崩溃)

上一篇 下一篇

猜你喜欢

热点阅读