M
M
MdaUZH2016-08-25 19:48:13
Android
MdaUZH, 2016-08-25 19:48:13

How to keep ObjectAnimator on screen rotation?

Hello.
Faced difficulty, you need to save the value of the animator when the screen is rotated, but I don’t understand and can’t figure out how to do it (except for crutches)

ObjectAnimator anim = ObjectAnimator.ofInt(progressBar, "progress", 800, 0);
        anim.setDuration(8000);
        anim.start();

When turning, everything starts all over again . There is also a timer in
AsyncTask, I save it with no problems, I can’t figure out how to save the value of the progress bar. The idea for each iteration is to do the following:
timer....
run(){
iter++;// проверить сколько раз сработал таймер
ObjectAnimator anim = ObjectAnimator.ofInt(progressBar, "progress", iter*100

But this is some kind of crutch, tell me how to be

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question