问题
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
}
}
回答1:
The _
Used for
- substitutes an unused parameter in a lambda expression
- substitutes an unused parameter in a destructuring declaration
For more information check this Keywords and Operators
来源:https://stackoverflow.com/questions/59006347/what-means-symbol-in-kotlin