(错误处理)Android 5.0 Service Intent must be explicit

来源:互联网 发布:淘宝小儿 编辑:程序博客网 时间:2024/05/29 18:00

Android 5.0程序运行报Service Intent must be explicit错误,原因是5.0的service必须显式调用

改成 Intent intent = new Intent(mContext, IService.class);

或者 Intent intent = new Intent("com.xx.xx.Service").setPackage("xx.xx.xx");

亲测第二个好用

0 0
原创粉丝点击