Reputation: 539
I tried to find information what it means but I didn't. Trying to understand what it does in this code:
checkBox.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
// The toggle is enabled
} else {
// The toggle is disabled
}
}
Upvotes: 4
Views: 3386
Reputation: 261
when user does't need a parameter in lembda expression then we can use "_"
setOnTouchListener { _, p1 ->
if (p1.action == MotionEvent.ACTION_DOWN) {
hideKeyboard()
true
} else
false
}
Upvotes: 1
Reputation: 69689
The _
Used for
For more information check this Keywords and Operators
Upvotes: 8