K
K
kvaks2020-01-22 15:42:26
Java
kvaks, 2020-01-22 15:42:26

How to handle events in the background in android?

I’m just starting to understand Android, and I don’t understand how to properly do some functions in the background, such as by pressing a button, but constantly.
For example, change color once per second.
Now I did it through the stream, but there is probably a simpler way?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2020-01-22
@kvaks

For the case as in the example, IMHO, it is best suited from the whole variety of tools
https://developer.android.com/reference/java/util/Timer
example
www.cyberforum.ru/post7226218.html

T
tiroman, 2020-01-22
@tiroman

Look towards RxJava

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question