bindService失败解决android.os.BinderProxy@41014958
2013-08-20 16:20
225 查看
Google Android Issue中有这个缺陷,缺陷详细信息在这里(Google Android Issue 2483),
Using getApplicationContext().bindService instead of just bindService on your activity solves the problem as it is using the higher level application context.
先调用getApplicationContext()获取其所属的Activity的上下文环境才能正常bindService,
也就是在onCreate()方法中使用this.getApplicationContext().bindService([args…])就可以了,否则bindService将永远失败返回false。
Using getApplicationContext().bindService instead of just bindService on your activity solves the problem as it is using the higher level application context.
先调用getApplicationContext()获取其所属的Activity的上下文环境才能正常bindService,
也就是在onCreate()方法中使用this.getApplicationContext().bindService([args…])就可以了,否则bindService将永远失败返回false。
相关文章推荐
- 解决Android版本更新,安装失败
- 解决android.os.NetworkOnMainThreadException
- 初学者android studio external libraries 中jar包添加失败解决方法
- Android Http请求失败解决方法
- 【Android问题】解决 Android SDK下载和更新失败“Connection to https://dl-ssl.google.com refused”的问题
- 解决Android7.0相机 android.os.FileUriExposedException
- 【Android开发那点破事】解决Andriod使用HttpURLConnection 失败问题
- 解决android.os.NetworkOnMainThreadException
- Caused by: android.os.NetworkOnMainThreadException错误解决办法
- android.os.NetworkOnMainThreadException异常如何解决
- android.os.BadParcelableException: ClassNotFoundException when unmarshalling:解决办法
- android 解决multidex打包失败的坑
- android.os.NetworkOnMainThreadException 解决办 4000 法
- 解决下载Android Build-tools 19.1.0失败
- Android开发中adb启动失败adb连接异常的解决办法
- Android记录10--android.os.NetworkOnMainThreadException异常解决办法
- 关于ENU OS加CHS VS2008出现包加载失败问题解决方法存档
- android:SharedPreference 读取失败的原因及解决办法
- 解决下载Android Build-tools 19.1.0失败