【问题标题】:Animators may only be run on Looper threads error on ObjectAnimator动画器只能在 ObjectAnimator 上的 Looper 线程错误上运行
【发布时间】:2014-02-06 07:46:10
【问题描述】:

我遇到了问题

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

animSet.start 后崩溃

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

请帮我解决这个问题..

【问题讨论】:

  • 阅读一些关于 Looper 类的资料

标签: android animation android-animation


【解决方案1】:

尝试添加

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-16
    • 2011-07-08
    • 2011-12-08
    相关资源
    最近更新 更多