I have this simple service that broadcasts the current location of the user. I want to use the binding mechanism just to control the service life-cycle, but the service is just
When you call bindService you may get this error:
bindService
ActivityManager java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.android.server.am.ActivityRecord$Token
Check the output of logcat.
This is a bug of Android.
To solve it, use getApplicationContext().bindService(...)
getApplicationContext().bindService(...)