The screen class connects to an event source via a callback and prints a service log. After a recent refactor, the log started behaving strangely when the screen was reopened: some events arrive one extra time, and unsubscription does not always affect the correct listener.
You need to determine the exact stdout output of this program after it is run.
ViewModel survives screen recreation, while the Fragment is created anew.Main.kt file.ViewModel;ViewModel;Run:
kotlinc Main.kt -include-runtime -d app.jar
java -jar app.jar
In your answer, provide the final program log as multiline stdout text without additional explanations.
Main.kt, without Android runtimeViewModel lives longer than the screen instance, the callback source stores listeners by referenceClick a line and write what it prints. Explanation is optional.