I’m posting here because I haven’t found the answer to my question yet after numerous searches. Actually, I would like to know if, in Kotlin, we could interrupt the execution of the main program to run a callback function linked to the interruption and then go back to the normal execution of the main program. So when the interruption comes, the program needs to memorize where it has stopped to be able to resume at the same place after it has finished running the callback function
Your help would be very much appreciated.
I’ve came across articles on Medium or some websites talking about interrupting threads, about coroutines but there weren’t really about what I was looking for..