Giter Site home page Giter Site logo

Comments (10)

showwiki avatar showwiki commented on May 21, 2024 2

我尝试改了下,试试看有没有修复这个bug。

实测一下,还是有问题的 ,
demo在这里 , showwiki@ee8e229
当从SplashFragment跳转到CommFragment , 点击goHome pushTo到HomeFragment, 再从HomeFragment跳转到其他页面,再返回 HomeFragment ,HomeFragment不会回调onStart onResume 从 backStack.removeLast() 清空的不彻底。换一种场景就无法覆盖了, qintaiyuan 提交的方案
是可以的。

from fragivity.

qintaiyuan avatar qintaiyuan commented on May 21, 2024 1

qintaiyuan@f6241f8

from fragivity.

qintaiyuan avatar qintaiyuan commented on May 21, 2024 1

val prevFragment = if (isPushTo) {
backStack.removeLast() // 这里没有清空是不是有问题
fragmentManager.fragments.forEach { ft.remove(it) }
fragmentManager.mBackStack?.clear()
null
} else {

from fragivity.

vitaviva avatar vitaviva commented on May 21, 2024

生命周期错乱具体就是指onResume没回调是吗, 我用源码里的demo跑了一下onResume是正常回调的。你的工程代码发出来看看?

from fragivity.

qintaiyuan avatar qintaiyuan commented on May 21, 2024

A页面pushTo到B页面B页面在push到C 这时候C页面pop到B B页面的onResum 就不回调了。用的是源码试的

from fragivity.

showwiki avatar showwiki commented on May 21, 2024

官方demo ,把SplashFragment 切换到HomeFragment的方法改为pushTo ,然后从HomeFragment push到其他页面,这个时候HomeFragment的生命周期是 onPause onStop ,当从其他页面页面再回到HomeFragment的时候,这个时候HomeFragment并没有如预想的调用onStart onResume

from fragivity.

qdsfdhvh avatar qdsfdhvh commented on May 21, 2024

我尝试改了下,试试看有没有修复这个bug。

from fragivity.

qdsfdhvh avatar qdsfdhvh commented on May 21, 2024

现在的代码不好依赖新的navigation;我想fork出一个精简版本,把show/hide改回replace。

from fragivity.

showwiki avatar showwiki commented on May 21, 2024

现在可以了,qdsfdhvh 我的测试代码你好像合并进去dev分支了, 回滚一下吧

from fragivity.

qdsfdhvh avatar qdsfdhvh commented on May 21, 2024

现在可以了,qdsfdhvh 我的测试代码你好像合并进去dev分支了, 回滚一下吧

不用啊,sample多一层跳转没什么问题的,方便测试。

from fragivity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.