This is probably too old for my answer to use it, but in case anyone else has this problem, thatโs what it was for me. I am using a newer version of the SDK, so I get this problem on line 1061.
This happened to me because I was passing a null ServiceConnection object to the bindService function.
It was useful to look at the SDK code in my case - although line numbers do not add up due to differences in version, the general code is probably the same (and I knew which method to check):
1097 // If there was an old service, it is not disconnected. 1098 if (old != null) { 1099 mConnection.onServiceDisconnected(name); 1100 } 1101 // If there is a new service, it is now connected. 1102 if (service != null) { 1103 mConnection.onServiceConnected(name, service); 1104 }
mConnection was pretty much the only thing that made sense to be null.
source share