初次接触Service笔记

Service是后台的运行的小程序,分两种一种是StarService()另外一种是bindService(),这种可调用Service中的方法和返回结果等操作而StarService不能

他的生命周期为onCreate,onStartCommand,onDestroy三个,当我们startService()的时候,首次创建Service会回调onCreate()方法,然后回调onStartCommand()方法

创建Service时候必须在manifests中配置

猜你喜欢

转载自www.cnblogs.com/hahabengbeng/p/11019912.html