At Last I found a solution to this.
progressbar = (ImageView) findViewById(R.id.imageView1);
progressbar.setBackgroundResource(R.drawable.progressbar);
final AnimationDrawable frame = (AnimationDrawable)getResources.getDrawable(R.drawable.progressbar); \\progressbar is the anim.xml file
progressbar.setBackgroundDrawable(frame);
progressbar.post(new Runnable() {
@Override
public void run() {
frame.start();
}
});
}