使用taggroup会持有context不释放,造成内存溢出
Opened this issue · 2 comments
lucheng0522 commented
已经找到解决方法, 在 onDestory()中将里面的标签清空
@OverRide
protected void onDestroy() {
super.onDestroy();
tagGroup.setTags("");
}
LiuJQ commented
I have the same question. tagGroup.setTags("") doesn't work.
wpq2014 commented
public void setTags(String... tags) {
removeAllViews();
for (final String tag : tags) {
appendTag(tag);
}
if (isAppendMode) {
appendInputTag();
}
}
最后又appendInputTag(),所以并没有彻底清空,
我觉得可以直接在onDestroy中调用mTagGroup.removeAllViews().