I have a animation list contains the following items
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res
/android"android:oneshot="true">
<item
android:drawable="@drawable/b1"
android:duration="500"/>
<item
android:drawable="@drawable/delay"
android:duration="1000"/>
<item
android:drawable="@drawable/b1"
android:duration="500"/>
<item
android:drawable="@drawable/delay"
android:duration="1000"/>
<item
android:drawable="@drawable/b2"
android:duration="500"/>
Now, when the animation is running or has started by the following
code,
img1 = (ImageView)findViewById(R.id.stimulichangeid);
img1.setBackgroundResource(R.drawable.erp_simple_presentationlist1);
AnimationDrawable splashanimation = (AnimationDrawable)img1.getBackground();
splashanimation.start();
I want to click some button when in animation list "b2" drawable
appears on the imageview.But in a running animation, how to access a
particular item(in my case b2). When b2 comes i want to press a button
and do something. i was thinking to assign id's to every item. if yes,
then how to access that particular item with its id when the
animation is running. please suggest some way to solve this problem.
thanks in advance