Call a new xml file which includes the frames that are to be loaded:
< ?xml version="1.0" encoding="utf-8"?> < animation-list android:oneshot="false" xmlns:android="http://schemas.android.com/apk/res/android"> < item android:drawable="@drawable/frame_above95_1" android:duration="30"/> < item android:drawable="@drawable/frame_above95_2" android:duration="30"/> < item android:drawable="@drawable/frame_above95_3" android:duration="30"/> < item android:drawable="@drawable/frame_above95_4" android:duration="30"/> < item android:drawable="@drawable/frame_above95_5" android:duration="30"/> < item android:drawable="@drawable/frame_above95_6" android:duration="30"/> < item android:drawable="@drawable/frame_above95_7" android:duration="30"/> < item android:drawable="@drawable/frame_above95_8" android:duration="30"/> < item android:drawable="@drawable/frame_above95_9" android:duration="30"/> < item android:drawable="@drawable/frame_above95_10" android:duration="30"/> < item android:drawable="@drawable/frame_above95_11" android:duration="30"/> < item android:drawable="@drawable/frame_above95_12" android:duration="30"/> < item android:drawable="@drawable/frame_above95_13" android:duration="30"/> < item android:drawable="@drawable/frame_above95_14" android:duration="30"/> < item android:drawable="@drawable/frame_above95_15" android:duration="30"/> < item android:drawable="@drawable/frame_above95_16" android:duration="30"/> < item android:drawable="@drawable/frame_above95_17" android:duration="30"/> < item android:drawable="@drawable/frame_above95_18" android:duration="30"/> < /animation-list>in java file:
img1.setBackgroundResource(R.layout.animation_above95); AnimationDrawable anim=(AnimationDrawable)img1.getBackground(); anim.start();
Comments
Post a Comment