0

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

Perkovec
  • 101
  • 1
  • 4

1 Answers1

1

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

sun
  • 11
  • 1