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

快速跳转jump数据丢失 #5

Open
AuroraStarMoon opened this issue Dec 9, 2020 · 4 comments
Open

快速跳转jump数据丢失 #5

AuroraStarMoon opened this issue Dec 9, 2020 · 4 comments

Comments

@AuroraStarMoon
Copy link

我在A界面中的setEvents()方法中直接写上如下代码,没错就是直接跳转
jump(ModuleTestActivity.class, new OnJumpResponseListener() {
@OverRide
public void OnResponse(JumpParameter jumpParameter) {
if (jumpParameter == null) {
toast("未返回任何数据");
} else {
toast("收到返回数据,参数“返回数据1”中的值为:" + jumpParameter.get("返回数据1"));
mTestText.setText((CharSequence) jumpParameter.get("返回数据1"));
}
}
});

然后B界面代码 setEvent()方法
if ((boolean) getParameter().get("needResponse") == true) {
setResponse(new JumpParameter().put("返回数据1", "测试成功"));
} else {
toast("needResponse = false:不需要返回数据给上一个界面");
}
new Thread(new Runnable() {
@OverRide
public void run() {
try {
Thread.sleep(3000);
finish();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();

返回到A界面弹框数据为NULL

@kongzue
Copy link
Owner

kongzue commented Dec 12, 2020

这是因为回传数据是在onResume后执行的,而当你一启动Activity就执行跳转回调会造成逻辑错误,请确保第一个Activity完成加载后进行跳转。

@kongzue
Copy link
Owner

kongzue commented Dec 12, 2020

后续版本我会对消息线进行改进,以将这种问题完全解决。

@kongzue
Copy link
Owner

kongzue commented Dec 12, 2020

如果你正在使用 AndroidX 版本,请更新至 6.7.7.6 测试版本,已修复此问题

@kongzue
Copy link
Owner

kongzue commented Dec 12, 2020

Support版本也已经同步更新至测试版本 6.7.7.6

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