Trying to cause the animation to play in a fragment of the activit. But I catch such a mistake:
android.util.AndroidRuntimeException: Animators may only be run on Looper threads
Here is the fragment method that I call from activation:
public void setConnect(){ ivOk.setPivotX(ivOk.getWidth()/2); ivOk.setPivotY(ivOk.getHeight() / 2); ObjectAnimator animator = ObjectAnimator.ofFloat(ivOk, "scale", 0, 1); animator.setDuration(350); animator.addListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { ivOk.setVisibility(View.VISIBLE); } @Override public void onAnimationEnd(Animator animation) { } @Override public void onAnimationCancel(Animator animation) { } @Override public void onAnimationRepeat(Animator animation) { } }); animator.start(); }