I need to organize the launch of a couple of operations every n seconds while the Activity is on the screen. How to do it better?

  • lifecycle what? - Vladyslav Matviienko
  • 3
    The easiest option is to start a timer (or handler + runnable) in onStart and destroy in onStop. - pavel
  • Yes, a good option. Make a comment reply, I will accept it. - Kota1921

1 answer 1

The proposed in the comments option:

самый простой вариант - запуск таймера (или handler + runnable) в onStart и destroy в onStop. 

It turned out quite simple and good solution to the problem.