Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在Activity中使用ToastUtils后finish当前activity,控制台会提示内存泄漏,用原生Toast.maketext就不会是咋回事呢? #1801

Open
roybill opened this issue Mar 19, 2024 · 5 comments
Assignees
Labels

Comments

@roybill
Copy link

roybill commented Mar 19, 2024

打印的泄漏日志:
android.view.WindowLeaked: Activity com.bank.account.BuyActivity has leaked window android.widget.ImageView{b3912b1 V.ED..... ......ID 0,0-296,146} that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:1038)
at android.view.ViewRootImpl.(ViewRootImpl.java:1022)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:401)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:154)
at com.blankj.utilcode.util.ToastUtils$WindowManagerToast.show(ToastUtils.java:630)
at com.blankj.utilcode.util.ToastUtils$ActivityToast.showWithActivityWindow(ToastUtils.java:739)
at com.blankj.utilcode.util.ToastUtils$ActivityToast.show(ToastUtils.java:680)
at com.blankj.utilcode.util.ToastUtils$2.run(ToastUtils.java:494)
at com.blankj.utilcode.util.ThreadUtils.runOnUiThread(ThreadUtils.java:70)
at com.blankj.utilcode.util.UtilsBridge.runOnUiThread(UtilsBridge.java:554)
at com.blankj.utilcode.util.ToastUtils.show(ToastUtils.java:483)
at com.blankj.utilcode.util.ToastUtils.show(ToastUtils.java:472)
at com.blankj.utilcode.util.ToastUtils.showShort(ToastUtils.java:412)

@1041411123
Copy link

一样的问题,有内存泄漏

@zhibo-tech
Copy link

一样的问题,有内存泄漏问题

@zhibo-tech
Copy link

@Blankj

@OneGreenHand-LXH
Copy link

在页面销毁的时候调用ToastUtils.cancel();
但是会取消吐司

@jerry9433
Copy link

顶一个

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants