Strange error since upgrading to Android 4.2.2 - Activity has leaked IntentReceiver

后端 未结 2 758
借酒劲吻你
借酒劲吻你 2021-01-01 20:12

I upgraded my Samsung Galaxy Tab 2 to Android 4.2.2 last night, and have since spotted some strange errors in LogCat which didn\'t appear before I \'upgraded\'.

相关标签:
2条回答
  • 2021-01-01 20:35

    I have the similar problem and I've asked this question on the Haptic developer's forum and received the following reply:

    The exception you see is a harmless warning and the OS will take care of freeing the resources mentioned in the exception. In other words, no need to worry or do anything about it.

    If you need any other details - go here

    0 讨论(0)
  • 2021-01-01 20:38

    From the stack trace I would say your Activity (masked here) registered a HapticFeedbackBroadcastReceiver that wasn't properly released. This is typically done in the onPause() lifecycle hook so that this gets called when you pause or close the Activity.

    Example code:

    @Override 
    protected void onPause() {
    
        super.onPause();
        if(broadcastReceiverInstance != null){
            unregisterReceiver(broadcastReceiverInstance);
        }
    }
    

    If you haven't registered any receivers yourself maybe the system has based on a keyboard that pops up so it could be a good idea to hide keyboards or any other element used within your app that might have haptic feedback activated. Think of custom keyboards, custom views, ... anything. To check that in more detail we would need more code.

    0 讨论(0)
提交回复
热议问题