LicenseChecker checkAccess leaks ServiceConnection

后端 未结 4 949
遥遥无期
遥遥无期 2021-01-07 22:18

I am receiving this exception in LogCat every time I press the Back button in my app:

Activity has leaked ServiceConnection com.android

4条回答
  •  不要未来只要你来
    2021-01-07 22:44

    Just put

    mChecker.onDestroy();
    

    on your onDestroymethod 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();
        }
    

提交回复
热议问题