I want to show an animation on a listitem button. The animation works fine. some other buttons which I didn't clicked also shows the animation.I found that the problem will be with recycling views in adapters. Can anyone help me to handle this situation.. Here is the code I have written: inside getview method of adapter:
viewHolder.getrate.setOnClickListener(
new CompoundButton.OnClickListener() {
public void onClick(View paramView) {
ListData rateobj = (ListData) viewHolder.getrate.getTag();
paramView.setBackgroundResource(R.drawable.spin_animation);
// Get the background, which has been compiled to an AnimationDrawable object.
frameAnimation = (AnimationDrawable) paramView.getBackground();
// Start the animation (looped playback by default).
frameAnimation.start();
NetworkRun nt = new NetworkRun(rateobj);
String number=rateobj.getDescription();
String num=number.replaceAll("\\s+","");
nt.execute(num);
viewHolder.load.setEnabled(true);
viewHolder.load.setVisibility(View.VISIBLE);
}
});