user1980076
user1980076

Reputation: 233

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.

Upvotes: 6

Views: 8812

Answers (2)

Etahudu
Etahudu

Reputation: 21

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

Upvotes: 2

laminatefish
laminatefish

Reputation: 5246

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!

Upvotes: 18

Related Questions