在Activity启动时会自动运行动画

来源:互联网 发布:施乐s2011网络打印 编辑:程序博客网 时间:2024/05/21 11:09
ImageView image = (ImageView) findViewById(R.id.animation_view);   
  
image.setBackgroundResource(R.anim.oldsheep_wait);   
  
animationDrawable = (AnimationDrawable) image.getBackground();   
image.post(new Runnable()   
{   
            @Override   
            public void run()   
            {   
                animationDrawable.start();  
            }   
  
        });