Skip to content

Instantly share code, notes, and snippets.

@renaudcerrato
Last active February 23, 2019 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renaudcerrato/edd2c9cb29d5522b06e392a08bce5b8f to your computer and use it in GitHub Desktop.
Save renaudcerrato/edd2c9cb29d5522b06e392a08bce5b8f to your computer and use it in GitHub Desktop.
Kotlin Anonymous Objects
val listener = object: OnMenuClickListener, OnMenuExpandListener {
override fun onMenuClick(item: Menu) { ... }
override fun onMenuExpand(item: Menu) { ... }
}
menu.setOnClickListener(listener)
menu.setOnExpandListener(listener)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment