Coder Social home page Coder Social logo

Comments (10)

mzule avatar mzule commented on May 1, 2024 1

@bobingxin 搞定了

compile 'com.github.mzule.activityrouter:activityrouter:1.2.1'
Intent intent = Routers.resolve(context, "mzule://main/0xff878798")

from activityrouter.

mzule avatar mzule commented on May 1, 2024

可以描述的更具体一些吗?

from activityrouter.

bobingxin avatar bobingxin commented on May 1, 2024

消息推送过来后,我们在broadcast receiver中收到通知,在这里面要做页面的跳转。
这样写无法打开
Routers.open(context, "mk:main");
这样写就可以了
Intent intent = new Intent(context, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP ); context.startActivity(intent);

from activityrouter.

mzule avatar mzule commented on May 1, 2024
Routers.open(context, "mk:main");

应该是

Routers.open(context, "mk://main");

from activityrouter.

bobingxin avatar bobingxin commented on May 1, 2024

应该是没有设置Flag的原因吧,在broadcastreceiver中打开activity需要添加Intent.FLAG_ACTIVITY_NEW_TASK这个flag。

from activityrouter.

bobingxin avatar bobingxin commented on May 1, 2024

我这边的问题,那个地方写错了。想要使用singletask在这块,Intent.FLAG_ACTIVITY_CLEAR_TOP这个flag怎么添加呢?

from activityrouter.

mzule avatar mzule commented on May 1, 2024

FLAG_ACTIVITY_NEW_TASK ActivityRouter 会根据 Context 类型自动添加,FLAG_ACTIVITY_CLEAR_TOP 暂时还添加不了。。下一步我添加一个 Routers.resolve(url) 来获取 Intent 的方法吧,这样可以方便添加各种 Flag。。。你觉得如何?

from activityrouter.

bobingxin avatar bobingxin commented on May 1, 2024

好的,这样能解决我这种特殊的需求了。

from activityrouter.

mzule avatar mzule commented on May 1, 2024

好的,我周末处理一下哈。

from activityrouter.

bobingxin avatar bobingxin commented on May 1, 2024

ok,谢谢了

from activityrouter.

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.