Comments (4)
仅开启应用内浮窗会存在内存泄漏 具体操作步骤:在B页面开启悬浮,返回A页面
java.util.ArrayList instance Leaking: UNKNOWN Retaining 300 B in 16 objects ↓ ArrayList[11] ~~~~ com.petterp.floatingx.imp.app.FxAppLifecycleImp instance Leaking: UNKNOWN Retaining 213 B in 6 objects ↓ FxAppLifecycleImp.helper ~~~~~~ com.petterp.floatingx.assist.helper.FxAppHelper instance Leaking: UNKNOWN Retaining 544.4 kB in 8765 objects context instance of cn.qssmart.tytptt.util.config.MyApp ↓ FxBasisHelper.iFxClickListener ~~~~~~~~~~~~~~~~ cn.qssmart.tytptt.ui.setting.SetUpActivity$15 instance Leaking: UNKNOWN Retaining 544.2 kB in 8758 objects Anonymous class implementing android.view.View$OnClickListener this$0 instance of cn.qssmart.tytptt.ui.setting.SetUpActivity with mDestroyed = true ↓ SetUpActivity$15.this$0 ~~~~~~ cn.qssmart.tytptt.ui.setting.SetUpActivity instance Leaking: YES (ObjectWatcher was watching this because cn.qssmart.tytptt.ui.setting.SetUpActivity received Activity#onDestroy() callback and Activity#mDestroyed is true) Retaining 544.2 kB in 8757 objects key = cade785e-25e7-4cac-ab5d-db66c7186754 watchDurationMillis = 51480 retainedDurationMillis = 46478 mContext instance of cn.qssmart.tytptt.ui.setting.SetUpActivity with mDestroyed = true mApplication instance of cn.qssmart.tytptt.util.config.MyApp mBase instance of androidx.appcompat.view.ContextThemeWrapper
能带一下你在Activity中显示浮窗的示例代码吗?
另外,建议将展示浮窗的代码单独封装为一个静态,而不是直接在某Activiry中,避免对象无法回收。
from floatingx.
from floatingx.
改写在静态类了,貌似没啥问题了
from floatingx.
改写在静态类了,貌似没啥问题了
因为你注册了touchListener,这种匿名内部类的方式导致隐式持有了外部activity,从而内存泄漏
from floatingx.
Related Issues (20)
- 悬浮窗能做到初始状态传递一个自定义View和整个屏幕一样大吗?然后在自定义View中去点击变成小窗模式,再点击还原到全屏悬浮窗 HOT 2
- 两个Activity如果使用了共享元素动画就会出问题 HOT 1
- setOffsetXY参数不支持构造者模式 HOT 1
- IFxViewLifecycle InitView 方法内设置View的子view点击事件无效 HOT 3
- 应用进程杀死问题 HOT 7
- 拖动松开以后,悬浮窗会自动贴边,如何判断悬浮窗是贴的左边还是右边? HOT 4
- 系统悬浮窗一闪而过 HOT 2
- App级别浮窗在多个Activity之间显示和隐藏会有问题 HOT 9
- 有没有点击悬浮窗外部消失的方法 HOT 1
- show()方法没调用的时候,updateViewContent没有效果 HOT 1
- 小米手机第一次弹悬浮窗切换页面悬浮窗自动消失了 HOT 4
- 锁屏然后亮屏 然后dialog里面显示floating,创建在了dialog下面 HOT 4
- 全屏的时候为啥 状态栏不会被覆盖 HOT 2
- setEnableAllBlackClass 没有这个方法啊 HOT 4
- 可以同时支持4个方向的贴边吗? HOT 1
- 如何动态更新 运行时配置(链接如下) HOT 1
- 浮窗比较大的时候,靠边吸附有问题,会一直靠左边吸附 HOT 3
- 支持ComposeView HOT 3
- 具体该怎么操作使用?小白一个.有没有详细的操作教程麻烦发下谢谢各位~!
- 想问一下如果我的浮窗内有2部分view,希望触摸上半部分的时候view能拖动浮窗位置,下半部分只响应内部事件,如何处理比较好
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from floatingx.