动画师只能在ObjectAnimator上的Looper线程错误上运行

时间:2014-02-06 07:46:11

标签: android animation android-animation

我遇到了问题

{
    AnimatorSet animSet = new AnimatorSet();
    animSet.start();
}

animSet.start

之后崩溃

获取消息android.util.AndroidRuntimeException: Animators may only be run on Looper threads...

请帮我解决这个问题..

1 个答案:

答案 0 :(得分:0)

尝试添加

new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        animSet.start();
                    }
                });
            }
        }, 100);