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
            }
        }
The _ Used for
For more information check this Keywords and Operators
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
        }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With