package com.ansen.frameanimation.sample; import android.app.Activity; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.support.annotation.Nullable; import android.widget.ImageView; import com.ansen.frameanimation.R; /** * Created by Ansen on 2017/3/24 09:28. * * @E-mail: [email protected] * @Blog: http://blog.csdn.net/qq_25804863 * @Github: https://github.com/ansen360 * @PROJECT_NAME: FrameAnimation * @PACKAGE_NAME: com.ansen.frameanimation.sample * @Description: TODO */ public class AnimationOne extends Activity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.one); ImageView image = (ImageView) findViewById(R.id.image); AnimationDrawable animationDrawable = (AnimationDrawable) image.getDrawable(); animationDrawable.start(); } }