I have a very function function inside the activity that takes a static date in the past, formats it to a relative string using DateUtils.getRelativeDateTimeString
(so it becomes something like "3 minutes ago" and sets it to a TextView
. However, I want this TextView
to keep updated so long as the activity stays open.
How do I make a continuous task that will either run continuously (infinite loop) or run within short intervals - like every second. How to accomplish this without getting into background services and such?