Adrien Zier Adrien Zier - 1 year ago 308
Android Question

Animators may only be run on Looper threads Android

I'm trying to animate something when a task is completed. The problem here is I get this error message:

android.util.AndroidRuntimeException: Animators may only be run on Looper threads
at android.animation.ValueAnimator.cancel(
at android.view.ViewPropertyAnimator.animatePropertyBy(
at android.view.ViewPropertyAnimator.animateProperty(
at android.view.ViewPropertyAnimator.alpha(

The app worked fine before with the same exact code but now it simply doesn't. I'm really confused.

Here's where the error happens:

new Thread(new Runnable() {
public void run() {
final String s = getGiphyViews(String.valueOf(mEdit.getText()));
runOnUiThread(new Runnable() {
public void run() {



The error outlines the

Thanks in advance!


Looper threads are threads in Android that permanently loop (or until you cancel them). They work in conjunction with Handlers which will post and send messages to Looper threads. Animators use heavy use of Looper threads because they perform their actions in repeated cycles. This allows the animator to not block after you press "start" so you can continue to perform other actions.

To further complicate matters, you most likely are performing animations on View objects. These can only be run on the main UI thread (which happens to be the biggest Looper thread of them all). So, you can not run these animations on separate threads like you are trying.