Converting java to kotlin, for a next and previous button

Viewed 44
@Override
    public void onClick(android.view.View v) {
        if (v == next) {
            viewFlipper.showNext();
        }
        else if (v == previous) {
            viewFlipper.showPrevious();
        }
    }

I'm trying to create a next and previous button on android studios using Kotlin, I found the code in java and would like to know how to convert it into kotlin. I've spent the whole day trying to figure it out, please help

1 Answers
   @Override fun onClick(v: View) {
        if (v === next) {
            viewFlipper.showNext()
        } else if (v === previous) {
            viewFlipper.showPrevious()
        }
    }
Related