I am following http://developer.android.com/guide/topics/graphics/view-animation.html#frame-animation with minor changes. I have decided to make the animation loop and want it to start from the get-go.
My animation is at drawable/listening.xml:
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item
android:drawable="@drawable/l_01"
android:duration="200" />
<item
android:drawable="@drawable/l_02"
android:duration="200" />
<item
android:drawable="@drawable/l_03"
android:duration="200" />
</animation-list>
and my init code:
@Override public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
animImg = (ImageView)findViewById(R.id.listen_anim);
animImg.setBackgroundResource(R.drawable.listening);
anim = (AnimationDrawable) animImg.getBackground();
anim.start();
};
All I see is the first frame and no other images.