I've been trying to set up a long click listener event, but keep getting the following error:
Type mismatch.
Required:Boolean
Found:Unit
我对setOnClickListener
项赛事没有异议,但由于某种原因,我对setOnLongClickListener
项赛事的运气为零.
I'm currently trying to display a simple Toast
:
view.setOnLongClickListener{
Toast.makeText(this, "Long click detected", Toast.LENGTH_SHORT).show();
}
I've seen plenty of examples for Java, but I'm yet to find any examples for Kotlin.