原出处:
https://github.com/egret-labs/egret-docs/tree/master/Native/native/externalinterface
Sign up
egret-labs
/
egret-docs
Code
Issues
9
Pull requests
3
Actions
Projects
Security
Insights
master
egret-docs/Native/native/externalinterface/
Latest commit
runinspring
…
on 28 Aug 2018
Git stats
Files
Type
Name
Commit time
. .
README.md
2 years ago
README.md
README.md
JS与Java通信
JS向Java发送消息
Java注册接收消息的方法:
nativeAndroid.setExternalInterface(“sendToNative”, new INativePlayer.INativeInterface() {
@Override
public void callback(String message) {
String str = "Native get message: ";
str += message;
Log.d(TAG, str);
}
});
JS发送消息:
egret.ExternalInterface.call(“sendToNative”, “