<How do I extract the call to setOnClickListener?>...
# stackoverflow
u
How do I extract the call to setOnClickListener? I have a bunch of button functions that merely toasts the label on the button. override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) binding.button1.setOnClickListener { Toast.makeText(activity?.applicationContext,binding.button1.getLabel(), Toast.LENGTH_SHORT).show() } binding.button2.setOnClickListener { Toast.makeText(activity?.applicationContext,binding.button2.getLabel(),...