Android: Memory leak due to AsyncTask

后端 未结 2 1968
-上瘾入骨i
-上瘾入骨i 2020-12-17 05:20

I\'m stuck with a memory leak that I cannot fix. I identified where it occurs, using the MemoryAnalizer but I vainly struggle to get rid of it. Here is the code:

<         


        
2条回答
  •  抹茶落季
    2020-12-17 05:29

    You can try below code snippet

    protected void onPostExecute(Boolean result) {
        if(YourActivity.this.isFinished()){
            //to smomething here
        }
    }
    

提交回复
热议问题