android:fix render callback thread error

This commit is contained in:
pengfei.zhou 2020-04-27 15:42:13 +08:00 committed by osborn
parent 57b5c7596b
commit 0535d0d4d4

View File

@ -74,6 +74,13 @@ public class ShaderPlugin extends DoricJavaPlugin {
viewNode.blend(jsObject.getProperty("props").asObject()); viewNode.blend(jsObject.getProperty("props").asObject());
} }
} }
Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() {
@Override
public boolean queueIdle() {
promise.resolve();
return false;
}
});
return null; return null;
} }
}, ThreadMode.UI).setCallback(new AsyncResult.Callback<Object>() { }, ThreadMode.UI).setCallback(new AsyncResult.Callback<Object>() {
@ -94,13 +101,6 @@ public class ShaderPlugin extends DoricJavaPlugin {
@Override @Override
public void onFinish() { public void onFinish() {
Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() {
@Override
public boolean queueIdle() {
promise.resolve();
return false;
}
});
} }
}); });
} }