Closed wflin2020 closed 1 year ago
When the toast is done showing, you shouldn't keep it in memory any longer, there's no use for that. Which is what the trace is telling you:
Leaking: YES (This toast is done showing (Toast.mTN.mWM != null && Toast.mTN.mView == null))
Thank you very much for your reply. One thing I don't understand is that I can't reproduce this problem on the emulator, Can I think this is a problem of some mobile phone manufacturers. If not, what is the reference chain of this memory leak(This ToastUtils
is want to make an application-level toast)?
I add LeakCanary(version:2.10) and I has this memory leak in my application. Here is my toast utils
When I call the
showShortToast
funcation, then finish the activity, I will receive a memory leak notificationCould you tell me the reason of the memory leak and help me solve this problem?