有些时候我们使用Service的时需要采用隐式意图启动的方式。
但是Android 5.0一出来后,其中有个特性就是 Service Intent must be explicit,也就是说从Lollipop开始,service服务必须采用显式意图方式启动.
1 | Intent intent = new Intent(); |
报错:
java.lang.IllegalArgumentException: Service Intent must be explicit
解决办法:
1 | Intent intent = new Intent(); |