0

i`m facing this memory leak after closing my activity by pressing back-button: enter image description here

Since i couldnt figure out what it is, i outcommented almost my whole code to:

protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
}

protected void onPause()
{
    super.onPause();
}

protected void onDestroy()
{
    super.onDestroy();
}

I guess it has something to do with AudioManager. But since i outcommented anything i dont have a clue what it could be.

Any advice?

Update: I`m facing the same "issue" while making a heap dump on a hello-world app, created by android studio.....so i guess its somehow normal. But whats the explanation for this?

treesoft
  • 295
  • 2
  • 14

1 Answers1

1

Even you are not using AudioManager, it might leak as some of the buttons in your UI might yield a click sound. For some reason, it might or might not leak.

A working solution for me was to use the workaround that can be found on github. Further discussion is available here: Android Context Memory Leak ListView due to AudioManager

Community
  • 1
  • 1
Sebastian Roth
  • 11,344
  • 14
  • 61
  • 110