1、在drawable里面存入几张图片,然后继续在drawable里面创建xml文件,取名myimg.xml,内容:

<?xml version="1.0" encoding="utf-8"?>

<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false" >
<item
android:drawable="@drawable/read_pig"
android:duration="250">
</item>
<item
android:drawable="@drawable/read_small"
android:duration="250">
</item>

</animation-list>

2、界面上留个imagview控件,id=@+id/img

ImageView gif= (ImageView) findViewById(R.id.img);//获取控件
gif.setImageResource(R.drawable.myimg);//img控件获取资源(创建的动图资源)
AnimationDrawable animationDrawable1 = (AnimationDrawable) gif.getDrawable();//动画资源
animationDrawable1.start();//开始动画