Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forwardForResult再activity异常destroy后再次调用无效 #127

Closed
wjzabc opened this issue Sep 30, 2022 · 2 comments
Closed

forwardForResult再activity异常destroy后再次调用无效 #127

wjzabc opened this issue Sep 30, 2022 · 2 comments

Comments

@wjzabc
Copy link

wjzabc commented Sep 30, 2022

ActivityA 调用
Router.with(this)
.host(ModuleConfig.File.HOST_FILE)
.path(path).putString(ModuleConfig.Scanner.TYPE, type)
.requestCode(FileConstant.REQUEST_CODE_DETAIL_ACTIVITY)
.forwardForResult
跳转到ActivityB, B在前台处理大量图片,导致低内存,A被系统destroy,然后back返回到A , 此时A调用以上代码跳转到B失效。

@xiaojinzi123
Copy link
Owner

xiaojinzi123 commented Sep 30, 2022

跳转失败吧 应该是 原因应该是使用了同一个 requestCode 的缘故

第一:你requestCode 不需要自己声明, 叫 框架自己创建一个即可, requestCodeRandom 方法即可
第二:我这边会做一个优化, 假设 requestCode 对应的 Activity 已经结束了, 我会对内置的 requestCode 池子进行移除

@xiaojinzi123
Copy link
Owner

不对 A 销毁的时候, 会取消路由的, 不是我刚刚说的问题。。 你最好查看具体的跳转失败的信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants