Skip to content

fragment中销毁binding时机 #61

Description

@wumeixinjiazu

不建议这么使用
thisRef.viewLifecycleOwner.lifecycle.addObserver(object : LifecycleObserver {
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
fun onDestroyView() {
Log.e("taggg", "onDestroyView viewLifecycleOwner$this")
_binding = null
}
})
因为这会导致比fragment更快的执行onDestroyView方法

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions