CreateProxy for Android (LuaJava)

343 views Asked by At

I've got a Lua function Button, which creates a button, add it to the layout and returns the button. Then I want to add to it ClickListener

local button = Button ("text", MATCH_PARENT, WRAP_CONTENT)
button: setOnClickListener (luajava.createProxy ("android.view.View.OnClickListener", {
         onClick = function (e)
             print ("clicked")
         end
     }
))

But the answer is just that:

Runtime error: java.lang.NoClassDefFoundError: android / view / View / OnClickListener
stack trackback:
[C]: in function 'createProxy'
...

P.S. Sorry for my english

1

There are 1 answers

0
sun On

"android.view.View.OnClickListener" should be "android.view.View$OnClickListener"