I am receiving this exception in LogCat every time I press the Back
button in my app:
Activity has leaked ServiceConnection com.android
I don't know about google's LicenceChecker, but you should call StopService() before exit the Activity otherwise the service is still running and leaks memory.
Just put
mChecker.onDestroy();
on your onDestroy
method of the activity that declares and uses the mChecker.
While Google's code in LicenceChecker
looks like this:
public synchronized void onDestroy() {
cleanupService();
mHandler.getLooper().quit();
}
I have also met the same problem later I got to know that i havn't added that android permission com.android.vending.CHECK_LICENSE . After correcting this my was problem is now solved. Try adding this line your android manifest
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
I just got the same problem, and with your update and zapl's comment I figured up that the problem is the emulator you are using.
This Emulators don't have the Google Play APIs, and the LVL can't bind to the service, leaving a connection open, at the end LVL can't close it with the onDestroy call.
Just create a new AVD using Google APIs instead of Android x.x and try your code there, if you don´t find the Google APIs in the Target pulldown when creating the new AVD download it with the Android SDK Manager.