lifecycle @onlifecycleevent()已弃用,您应该使用LifeCycleEventObserver或DefaultLifeCycleObServer
答案在底部,
我认为这对您有用
Answer is on bottom
I think it will be useful for you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1- LifeCycleVentObserver
首先
您应该实现以下操作:
”旧的依赖性已被弃用:
新的依赖性,您应该使用此
其次
应该写这件:
第三,
您应该写下:
在这里,我仅实施了两个生命周期事件,当您需要其他生命周期事件时,您应该实现它们
2- defaultlifecycleobserver,
首先
您应该实现此处:
其次,
您应该写下:
第三,
您应该写下:
在这里,我仅实施了两个生命周期事件,当您需要其他生命周期事件时,您应该实现它们
3-活动lifecyClecallbacks,
首先
您应该写下:
其次,
您应该写这篇文章:
1 - LifecycleEventObserver
Firstly
You should implementation this: more info
Old dependency have been deprecated:
New dependency, You should use this
Secondly
You should write this:
Thirdly
You should write this:
In here I implemented only two Lifecycle Event, when you need other Lifecycle Event, you should implement them
2 - DefaultLifecycleObserver
Firstly
You should implementation this:
Secondly
You should write this:
Thirdly
You should write this:
In here I implemented only two Lifecycle Event, when you need other Lifecycle Event, you should implement them
3 - ActivityLifecycleCallbacks
Firstly
You should write this:
Secondly
You should write this: