1 year ago

#360244

test-img

musclebananas

False positive "This animation should be started with #start()" lint warning

"Missing recycle() calls"

I got a lint warning on previously implemented animations (on ofInt() to be precise) after updating Android Studio to Bumblebee 2021.1.1 Patch 2 from 4.2.1.

What's interesting, is that when I use it like this, I get the warning:

ObjectAnimator.ofInt(progressBar, "progress", 50).apply {
    startDelay = 300L
    duration = 1500L
    start()
}

But when I save it in a variable like this, I get no warning:

val objectAnimator = ObjectAnimator.ofInt(progressBar, "progress", 50).apply {
    startDelay = 300L
    duration = 1500L
    start()
}

Any ideas why it's happening?
Any ideas how to resolve/prevent the warning without saving this operation in a variable unnecessarily?

android

kotlin

lint

android-studio-bumblebee

0 Answers

Your Answer

Accepted video resources