Android报错IllegalArgumentException: Service Intent must be explicit
来源:互联网 发布:轩辕传奇账号交易淘宝 编辑:程序博客网 时间:2024/06/06 04:02
在进行本地调用远程服务的时候,绑定服务使用的隐式意图,结果报错了。
//1 调用bindService获取中间人对象 Intent intent = new Intent(); intent.setAction("com.example.a69_remote_service"); //这句报错,不能用隐式意图。 conn = new MyConn(); //2 连接服务 目的为了获取我们定义的中间人对象 bindService(intent, conn, BIND_AUTO_CREATE);
经查找:
Android5.0系统后,不再允许使用隐式意图来绑定服务。
需要修改为显示意图,或更明确的意图。
//1 调用bindService获取中间人对象 Intent intent = new Intent(); intent.setAction("com.example.a69_remote_service"); intent.setPackage("com.example.a69_remote_service"); //!!!添加一个包,设置一个更明确的意图。 conn = new MyConn(); //2 连接服务 目的为了获取我们定义的中间人对象 bindService(intent, conn, BIND_AUTO_CREATE);
0 0
- Android报错IllegalArgumentException: Service Intent must be explicit
- Android报错:Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent
- IllegalArgumentException:Service Intent must be explicit
- IllegalArgumentException: Service Intent must be explicit
- Android5.0报错:java.lang.IllegalArgumentException: Service Intent must be explicit
- 启动Service报错:Service Intent must be explicit
- java.lang.IllegalArgumentException: Service Intent must be explicit: Intent {
- android5.0之后必须显示调用,否则报java.lang.IllegalArgumentException: Service Intent must be explicit
- android L 出现的问题IllegalArgumentException: Service Intent must be explicit: Intent
- java.lang.IllegalArgumentException: Service Intent must be explicit
- java.lang.IllegalArgumentException: Service Intent must be explicit
- java.lang.IllegalArgumentException: Service Intent must be explicit解决方法
- java.lang.IllegalArgumentException: Service Intent must be explicit异常说明
- Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit:
- java.lang.IllegalArgumentException: Service Intent must be explicit
- java.lang.IllegalArgumentException: Service Intent must be explicit 异常说明
- java.lang.IllegalArgumentException: Service Intent must be explicit 异常解决
- java.lang.IllegalArgumentException: Service Intent must be explicit解决方法
- 启动eclipse时需要对jvm进行配置,并设置启动时间
- 9.vsftpd服务 SElinux
- Android利用代码开启关闭飞行模式
- mac Android Studio内存配置与使用情况的展示
- 笔记5-JAVA的初学浅识(Java 对象和类 简单例子)
- Android报错IllegalArgumentException: Service Intent must be explicit
- Xcode开发c++程序时,openssl/aes.h: No such file or directory(或者是file not found)怎么解决
- uva 567 risk floyd
- A题
- spring集成mybatis后,打印SQL语句
- AngularJS入门之Angular内置指令
- openGL— 中点Bresenham画圆
- Xamarin.ios 下拉刷新效果
- Android--打开相机直接获取所拍摄的图片