The code simulates an Android screen that subscribes to an event source in onStart() and is supposed to unsubscribe correctly in onStop(). Right now, in the scenario where the screen is reopened, the final log in stdout is incorrect.
main().onStart() and onStop() are called strictly in the order from main().Main.kt.SensorSource;onStart();A;onStop();onStart() again;B;Run command:
kotlinc Main.kt -include-runtime -d app.jar && java -jar app.jar
stdout.| separators and character case.2.0Main.ktemit()Click a line and write what it prints. Explanation is optional.