2018-08-07 Recycle

2018-08-07  本文已影响0人  AndroidTalent

https://www.jianshu.com/p/ccfd58a0f3ac文档有解释

"Recycle": Missing recycle() calls

实际代码中,

val typedArray =context.obtainStyledAttributes(attrs, R.styleable.searchview)

TypedArray对象typedArray是需要回收执行recycle的,

所以在typedArray使用完成后执行typedArray.recycle();即可

上一篇 下一篇

猜你喜欢

热点阅读