Comments (4)
非常感谢你的提交和建议,这个问题在 1.0.9 上修复了
from binding.
非常感谢, 你是对的, view 生命周期比 fragment 周期短,也确实存在多种情况, view 被销毁了,而fragment 依然存在,也可能会出现造成多个 Observer 的情况,而 ViewBinding 和 DataBinding 都是 View 相关的,应该使用 viewLifecycleOwner, 我会在下一个版本一起修复这个问题,再次感谢
from binding.
我指的不是 binding 中添加 addObserver, 而是 fragment.lifecycle 和 fragment.viewLifecycleOwner 可能是会存在多个的,
from binding.
用 registerFragmentLifecycleCallbacks
会不会更直观一点,不过注册时机需要在获取 value 的时候。
from binding.
Related Issues (20)
- 在Navigation启动的Fragment中使用报错 HOT 1
- ActivityDataBinding里OS版本小于Q时为什么要添加一个空白的fragment? HOT 1
- 在BRAVH中怎么使用呢 HOT 1
- NoSuchMethodException问题 HOT 2
- 使用viewbind时,如何在使用xml布局的自定义ViewGroup中使用呢 HOT 4
- 版本时间写错啦,都2021年啦 HOT 5
- ActivityViewBinding 是否应该主动在onCreate时调用setContentView HOT 1
- 自定义View的混淆规则 HOT 2
- 遇到个bug HOT 9
- Fatal Exception: java.lang.IllegalStateException: onGetLayoutInflater() cannot be executed until the Fragment is attached to the FragmentManager. HOT 13
- 更新kotlin后,出现一下问题 HOT 2
- 关于ViewGroupDataBinding的一个问题 HOT 6
- SmartRefreshLayout自定义RefreshHeader时,报java.lang.NoSuchMethodException的错误 HOT 13
- 1.1.6版本找不到databind了 HOT 3
- 同一类型的多个 fragment 实例的 binding.view 引用错位问题 HOT 2
- Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option HOT 1
- onGetLayoutInflater() cannot be executed until the Fragment is attached to the FragmentManager HOT 4
- 开启混淆会报错,按照文档添加了混淆规则
- 有一定的几率会报错闪退,Android 12 红米手机 HOT 1
- -
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 binding.