feat:fix in Android promise invoked immediately

This commit is contained in:
pengfei.zhou 2019-12-02 15:16:27 +08:00
parent 9b9d8de262
commit 359e974424

View File

@ -145,6 +145,7 @@ public class ShaderPlugin extends DoricJavaPlugin {
};
AsyncResult<JavaValue> asyncResult = getDoricContext().getDriver()
.asyncCall(callable, ThreadMode.UI);
if (!method.getReturnType().equals(Void.TYPE)) {
asyncResult.setCallback(new AsyncResult.Callback<JavaValue>() {
@Override
public void onResult(JavaValue result) {
@ -163,6 +164,7 @@ public class ShaderPlugin extends DoricJavaPlugin {
});
}
}
}
} catch (ArchiveException e) {
e.printStackTrace();
}