Android 中 点击按钮调用AlphaAnimation的 start() 方法无效是什么原因?

代码如下:

 public class MainActivity extends Activity {

    private ImageView imageView;
    private Button start, stop;

    private AlphaAnimation animation;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        imageView = findViewById(R.id.gif);
        start = findViewById(R.id.startAnimation);
        stop = findViewById(R.id.stopAnimation);
        animation = new AlphaAnimation(1.0f, 0.0f);

        start.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                animation.setDuration(3000);
                animation.setStartOffset(0);
                imageView.startAnimation(animation);
            }
        });
    }

}

直接调用 View 的 startAnimation 方法可以启动动画,但是调用动画的 start 或startNow 方法却无效。

但是直接在 onCreate 方法中调用 start 或者 startNow 却可以启动,请问是什么原因?

大概,...也许...你的动画没和view绑定吧