Comments (10)
我尝试改了下,试试看有没有修复这个bug。
实测一下,还是有问题的 ,
demo在这里 , showwiki@ee8e229
当从SplashFragment跳转到CommFragment , 点击goHome pushTo到HomeFragment, 再从HomeFragment跳转到其他页面,再返回 HomeFragment ,HomeFragment不会回调onStart onResume 从 backStack.removeLast() 清空的不彻底。换一种场景就无法覆盖了, qintaiyuan 提交的方案
是可以的。
from fragivity.
from fragivity.
val prevFragment = if (isPushTo) {
backStack.removeLast() // 这里没有清空是不是有问题
fragmentManager.fragments.forEach { ft.remove(it) }
fragmentManager.mBackStack?.clear()
null
} else {
from fragivity.
生命周期错乱具体就是指onResume没回调是吗, 我用源码里的demo跑了一下onResume是正常回调的。你的工程代码发出来看看?
from fragivity.
A页面pushTo到B页面B页面在push到C 这时候C页面pop到B B页面的onResum 就不回调了。用的是源码试的
from fragivity.
官方demo ,把SplashFragment 切换到HomeFragment的方法改为pushTo ,然后从HomeFragment push到其他页面,这个时候HomeFragment的生命周期是 onPause onStop ,当从其他页面页面再回到HomeFragment的时候,这个时候HomeFragment并没有如预想的调用onStart onResume
from fragivity.
我尝试改了下,试试看有没有修复这个bug。
from fragivity.
现在的代码不好依赖新的navigation;我想fork出一个精简版本,把show/hide改回replace。
from fragivity.
现在可以了,qdsfdhvh 我的测试代码你好像合并进去dev分支了, 回滚一下吧
from fragivity.
现在可以了,qdsfdhvh 我的测试代码你好像合并进去dev分支了, 回滚一下吧
不用啊,sample多一层跳转没什么问题的,方便测试。
from fragivity.
Related Issues (20)
- 不保留活动恢复后导航图不存在导致奔溃问题
- 关于单Activity,从loadRoot中跳转其他页面时设置属性popSelf = true的问题 HOT 2
- [IllegalStateException] Fragment xxx not associated with a fragment manager. HOT 6
- 如何清空backstack再启动一个新fragment呢 HOT 24
- 调整显示大小,发生闪退 HOT 6
- 关于Activity重建时异常闪退问题 HOT 2
- 集成文档缺少调用proxyFragmentFactory的说明,另外这个Java的API建议统一封装到Fragivity类里
- 关于类似自定义抽屉式菜单或者底部菜单的多个顶层导航的功能无法实现 HOT 4
- [Deep Links]handleDeepLink添加NavOptions HOT 2
- 怎么把fragment设置成透明呢? HOT 1
- 关于popSelf跳转界面和替换根布局的问题 HOT 2
- 关于设置全局动画的建议 HOT 1
- 采用 CallBack 构造Fragment的时候 切换动画无效 HOT 3
- 0.3.1 版本 navigator.push 携带参数并设置 popSelf = true 会闪退 HOT 1
- 使用navigator.pushTo后fragment生命周期问题 HOT 1
- Can not perform this action after onSaveInstanceState
- 当升级为 navigation-fragment-ktx:2.4.0 和 androidx.navigation:navigation-ui-ktx:2.4.0 时跳转报错 HOT 2
- Fragment 生命周期回调异常 HOT 2
- 大佬还在维护吗?Navigation 2.6.0+ 版本兼容问题 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 fragivity.