Comments (10)
@bobingxin 搞定了
compile 'com.github.mzule.activityrouter:activityrouter:1.2.1'
Intent intent = Routers.resolve(context, "mzule://main/0xff878798")
from activityrouter.
可以描述的更具体一些吗?
from activityrouter.
消息推送过来后,我们在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.
Routers.open(context, "mk:main");
应该是
Routers.open(context, "mk://main");
吧
from activityrouter.
应该是没有设置Flag的原因吧,在broadcastreceiver中打开activity需要添加Intent.FLAG_ACTIVITY_NEW_TASK这个flag。
from activityrouter.
我这边的问题,那个地方写错了。想要使用singletask在这块,Intent.FLAG_ACTIVITY_CLEAR_TOP这个flag怎么添加呢?
from activityrouter.
FLAG_ACTIVITY_NEW_TASK
ActivityRouter 会根据 Context 类型自动添加,FLAG_ACTIVITY_CLEAR_TOP
暂时还添加不了。。下一步我添加一个 Routers.resolve(url) 来获取 Intent 的方法吧,这样可以方便添加各种 Flag。。。你觉得如何?
from activityrouter.
好的,这样能解决我这种特殊的需求了。
from activityrouter.
好的,我周末处理一下哈。
from activityrouter.
ok,谢谢了
from activityrouter.
Related Issues (20)
- 不支持activity之间intent透传
- 无法进行复杂数据类型传递,譬如ArrayList等 HOT 2
- ActivityRouter实现原理
- ActivityRouter原理 HOT 2
- ActivityRouter实现原理
- RouterInit NotFound HOT 2
- 当activity为singtask模式时的问题
- 多模块需要主模块依赖其他子模块?
- 是否还会维护? HOT 2
- 是否还会维护
- url address contains “&” HOT 2
- 含有“#”的链接后面拦截问题; HOT 1
- 使用annotationProcessor 这个无法多module跳转
- 可以从自己 app 的 webview 跳到自己的 activity 吗?
- 多地址转换
- RouterInit错误 HOT 3
- url参数搞不定? HOT 1
- 没有搞懂怎么引入 HOT 1
- android x的适配 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 activityrouter.