Problem: Shows only the first element in the animation-list.
Animation list drawable file in res/drawable:
<?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/k2si"
android:duration="1000"/>
<item
android:drawable="@drawable/android"
android:duration="1000"/>
</animation-list>
Starting the animation:
ImageView image = (ImageView) findViewById(R.id.imageView1);
image.setBackgroundResource(R.drawable.screensaver_image);
((AnimationDrawable) image.getBackground()).start();
Documentation (scroll to Frame animation)
Please see the similar question here
Starting frame by frame animation
you will get an idea about frame by frame animation.
If you didn't understood check the link below, good tutorial for frame by frame animation using XML file.
frame by frame xml animation with google android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With