The code below simulates a screen that starts collecting a Flow when it enters the STARTED state and stops collecting when it leaves STOPPED. After the screen is started again, the console receives lines from the current implementation. The exact output of the program must be determined.
repeatOnStarted works.STOPPED -> STARTED -> STOPPED -> STARTED.Flow will be printed and in what order.kotlinc Main.kt -cp kotlinx-coroutines-core-jvm-1.8.1.jar -include-runtime -d app.jar && java -cp app.jar:kotlinx-coroutines-core-jvm-1.8.1.jar MainKt
stdout without omissions or extra characters.2.0org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.1runBlocking is used, separate dispatchers are not switchedFakeLifecycle class, with no process recreationClick a line and write what it prints. Explanation is optional.