Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClassCastException: android.os.BinderProxy cannot be cast

I am getting this ClassCaseException -

/ActivityManager(213): Bad activity token: android.os.BinderProxy@420b43f0
W/ActivityManager(213): java.lang.ClassCastException: android.os.BinderProxy cannot be cast to 
com.android.server.am.ActivityRecord$TokenW/ActivityManager(213): at 
com.android.server.am.ActivityRecord.forToken(ActivityRecord.java:295)
W/ActivityManager(213): at com.android.server.am.ActivityManagerService.configureSoftkeysActivity(ActivityManagerService.java:15095)
W/ActivityManager(213): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:1572)W/ActivityManager(213):     at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1646)
W/ActivityManager(213): at android.os.Binder.execTransact(Binder.java:338)
W/ActivityManager(213): at dalvik.system.NativeStart.run(Native Method)

Do any one has any idea why I am getting this exception. Thanks in advance.

like image 558
user1980076 Avatar asked Jan 22 '13 12:01

user1980076


2 Answers

I know it's old, but thought I'd answer as I've just solved this myself. This (for me) is due to having android:process in my Service declaration of the application manifest. Simply removing that solved my issue immediately.

Hope this helps someone!

like image 193
fantasitcalbeast Avatar answered Nov 15 '22 09:11

fantasitcalbeast


If service to bind is in different process with the caller, you should use AIDL interface.

like image 22
Etahudu Avatar answered Nov 15 '22 07:11

Etahudu