[Android分享] 如何解决Android 5.0中出现的警告:Service Intent must be explicit

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!

原文地址:https://www.cnblogs.com/blogofwu/p/4524593.html