黑子
怎么持续输出内容啊,不成功啊,要持续返回内容,前端怎么接收啊!!!
@JSMethod(uiThread = true)
public void showTest1(JSONObject option, JSCallback jsCallback) {
action = jsCallback;
title = option.getString("name");
if (timer == null) {
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
title="Hello";
JSONObject res1 = new JSONObject();
res1.put("id", System.currentTimeMillis());
res1.put("name", title);
Log.i("run", res1.getString("id"));
action.invoke(res1);
}
}, 0,1000);
}
Log.i("test", "showTest1: ");
JSONObject res = new JSONObject();
res.put("id", System.currentTimeMillis());
res.put("name", title);
jsCallback.invoke(res);
}
2020-02-25 11:05
69 个评论
要回复文章请先登录或注册
test_a
九尾猿
墨溪
4***@qq.com
黑子
l***@live.com
龙小川
3***@qq.com
DCloud_Android_ST (作者)
DCloud_Android_ST (作者)