Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animation-list not working - shows only the first element

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)

like image 920
Indrek Kõue Avatar asked Jan 04 '12 11:01

Indrek Kõue


1 Answers

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

like image 75
Yugandhar Babu Avatar answered Nov 15 '22 18:11

Yugandhar Babu