[Android分享] 如何解决Android 5.0中出现的警告:Service Intent must be explicit
16lz
2021-01-23
Android 5.0程序运行报Service Intent must be explicit错误,原因是5.0的service必须显式调用
改成 Intent intent = new Intent(mContext, IService.class);
或者Intent intent = new Intent();
intent.setclass(xx.xx,xx.xx);
网上说的如下方式是不可行的:
Intent intent = new Intent("com.xx.xx.Service").setPackage("xx.xx.xx");
无法正常启动service!
更多相关文章
- [转]Android SDK升级时的错误及解决方法
- unity导出android遇到的build target 错误详解
- Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决
- android的ndk编译时错误__android_log_print无法找到定义
- Android使用HttpClient时出现错误:java.lang.NoSuchFieldError: N
- Android Studio查看错误信息
- android studio导入jar 后产生的 gradle 错误
- android studio常见错误及异常处理记录
- android studio 错误总结