ДН
Size: a a a
ДН
M
OM
public interface IUnity {
public void foo();
}
public class FooClass {
public IUnity unity = null;
public void setUnityImpl(IUnity unity) {
unity = unity;
}
@JavascriptInterface
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
unity.foo();
}
}
VS
ДН
public interface IUnity {
public void foo();
}
public class FooClass {
public IUnity unity = null;
public void setUnityImpl(IUnity unity) {
unity = unity;
}
@JavascriptInterface
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
unity.foo();
}
}
ДН
OM
var proxy = new UnityProxy();
AndroidJavaObject obj = ....
obj.Call("setUnityImpl", proxy);
OM
ДН
ДН
ЯС
GR
V
ID
ID
V
ID
V
Т
RI