I am transforming a large project into Kotlin. There were numerous problems. I am studying new Kotlin models - one of them. I hope I have a template that I can use to solve this problem.
Here is the code I'm trying to achieve. But break invalid in the when statement.
while (!mStopped && c.moveToNext()) { val itemType = c.getInt() when (itemType) { 1, 2 -> { doSomething() if (condition) continue doSomethingElse() } } doTheLastStuff() }
This is a very shortened version of the code. The Java source code had 100 lines inside the switch statements and a lot of continue and break .
What I'm trying to achieve is to continue execution in a while statement. What is the template for this in Kotlin
source share