美文网首页
fragment 状态

fragment 状态

作者: zlzxm | 来源:发表于2019-06-29 18:04 被阅读0次

isAdded : 在 onAttach (不包括)之后     onCreateView之前 就已经是 true;

isDetached :应该是对应 isAdded 的 调用 事务 detach 会 使fragmen走向ondestoryview 此时 返回true;

isHidden : 对应 事务管理的show 和 hidden

isRemoving: 对应事务的 remove     remove操作   ondetach 周期时 就会 返回isremoveing不会影响isDetached的返回值;

isVisible :

return this.isAdded() && !this.isHidden() &&this.mView !=null &&this.mView.getWindowToken() !=null &&this.mView.getVisibility() ==0;     所以要在activityonresume之后 才有token 才能返回true;

相关文章

网友评论

      本文标题:fragment 状态

      本文链接:https://www.haomeiwen.com/subject/ffimaqtx.html