We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java:
MyBean myBean; //测试全局变量参数读写 @Test public void testUpdateMyBean() { try { Log.d("testUpdateMyBean", "=============== test1"); LuaState lua = LuaStateFactory.newLuaState(); lua.openLibs(); myBean = new MyBean(); myBean.name = "zhang3"; myBean.age = 18; System.out.println(myBean); lua.pushJavaObject(myBean); lua.setGlobal("myBean"); String str = Config.getRawString(ctx, R.raw.testupdatemybean); System.out.println(str); int result = lua.LdoString(str); System.out.println("result==" + result); String msg = lua.toString(-1); System.out.println("msg==" + msg); lua.getGlobal("myBean"); myBean = (MyBean) lua.toJavaObject(-1); lua.pop(1); System.out.println(myBean); lua.close(); } catch (Exception e) { e.printStackTrace(); } Log.d("testUpdateMyBean", "=============== test2"); } public static class MyBean { private String name; private Integer age; public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } @Override public String toString() { return "MyBean{" + "name='" + name + '\'' + ", age=" + age + '}'; } }
testupdatemybean.lua:
myBean:setName('li4') myBean:setAge(50)
错误日志:
Invalid method call. No such method.
The text was updated successfully, but these errors were encountered:
可能确实存在问题,暂时没时间细看。 暂时直接使用 int?
int
Sorry, something went wrong.
No branches or pull requests
Java:
testupdatemybean.lua:
错误日志:
Invalid method call. No such method.
The text was updated successfully, but these errors were encountered: