Today under the official demo code under the Android system, we need to start a service and bind, but after the program starts, always error: Activity mainactivity has leaked serviceconnection Camerautil $[email protected]That is originally bound Hereandroid.app.ServiceConnectionLeaked:Activity mainactivity has leaked serviceconnection camerautil$[email protected]That is originally bound here error message as above, by Baidu learned that the appearance of this mainactivity has leaked serviceconnection,xxx is originally bound here reasons, many people say that the cause of this anomaly is in the activity destruction, Unbindservice is not called. So I in the activity of destory inside add unbindservice code, found or error, because in fact we have added Unbindservice in OnStop, so this is not our main cause of the error. After a few searches, the original is because I need to start in the program and binding server is not registered in the Androidmanifest.xml, so add the registration code is OK.
Reprint Please specify Source: http://www.cnblogs.com/lihaiping/p/6120528.html
(formerly) The mainactivity has leaked serviceconnection error when binding server under the Android system