Git Product home page Git Product logo

Comments (3)

YoKeyword avatar YoKeyword commented on May 28, 2024

@feng0403 你的需求是:不管在哪个Fragment,你都想直接跳转到目标Fragment是吗?
2种情况:
1、当前Fragment和目标在同一个栈层级下,使用SingleTask可以跳转到目标Fragment,不过该目标Fragment所处的栈之上的Fragment会被出栈

2、 如果是不同栈层级.... 还是建议重新加载一个目标Fragment吧...

最后,你的需求有些奇怪,如果你的情况是第2种,建议重新思考下如何规划栈层级关系,避免这种设计 :)

from fragmentation.

feng0403 avatar feng0403 commented on May 28, 2024

我的需求是这样的: 收到一个服务器推送的通知,弹出一个Dialog,点击后跳转到某个Fragment。
这个Fragment所处层级,类似上图的CycleFragment

from fragmentation.

YoKeyword avatar YoKeyword commented on May 28, 2024

@feng0403 这样啊,那你需要判断下
比如启动上述的CycleFragment,你首先是先切到MultiThirdFragment这里,然后通过它的getChildTopFragment.start(CycleFragment,SingleTask) 这样就到了CycleFragment

总体思路就是:先到目标Fragment的父Fragment,再通过getChild相关操作找到目标同级的Fragment,然后再通过start跳转 :)

from fragmentation.

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.