Open leviluo opened 1 year ago
EasyFloat.with(this).setTag("chanage").setLayout(R.layout.fuqiu).setShowPattern(ShowPattern.FOREGROUND).setDisplayHeight { context -> DisplayUtils.rejectedNavHeight(context) }.setGravity(Gravity.END or Gravity.BOTTOM, 0, -200).show()
this.finish()
当前activity关闭运行finish之后内存就泄露
嗯嗯,我想到了解决方法如下: var act1 = ActivityUtil.instance.getActivity(MainActivity::class.java) act1?.let { EasyFloat.with(it).setTag("chanage").setLayout(R.layout.fuqiu){
MainActivity是我的底层Activity,传入with方法,永远不会销毁,也就不会内存泄露
EasyFloat.with(this).setTag("chanage").setLayout(R.layout.fuqiu).setShowPattern(ShowPattern.FOREGROUND).setDisplayHeight { context -> DisplayUtils.rejectedNavHeight(context) }.setGravity(Gravity.END or Gravity.BOTTOM, 0, -200).show()
this.finish()
当前activity关闭运行finish之后内存就泄露