Skip to content

Instantly share code, notes, and snippets.

@pramonow
Created November 20, 2020 10:10
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 pramonow/bd4bc937ed883c96da08a9d3449bc54b to your computer and use it in GitHub Desktop.
Save pramonow/bd4bc937ed883c96da08a9d3449bc54b to your computer and use it in GitHub Desktop.
class DemoActivity : AppCompatActivity(){
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_demo)
//now we creating adapter and passing in a lambda method
var demoAdapter = DemoAdapter{ item -> doClick(item) }
}
//creating method to make it look simpler
fun doClick(item:Any) {
//do things related to activity
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment