What is the appropriate action to take when you need to change the background image of a ProgressBar? I mean should use a .gif image like : http://2.bp.blogspot.com/-O7nsXfmg
you need to get all this gif frame image as individual and then set into the animation-list in xml file.
Here is your anim_progress.xml file code
set the duration for change as smooth effect for giving animated image like gif
Here is the code for using this file
ImageView iv = new ImageView(this);
iv.setBackgroundResource(R.drawable.anim_progress);
final AnimationDrawable mailAnimation = (AnimationDrawable) iv.getBackground();
iv.post(new Runnable() {
public void run() {
if ( mailAnimation != null ) mailAnimation.start();
}
});
setContentView(iv);
you can get all frames from gif file from this site.
http://gif-explode.com/
for example
http://2.bp.blogspot.com/-O7nsXfmgwSc/T6PQ0PVr6-I/AAAAAAAAAQI/-eXkEXj24-s/s1600/02.gif
this link just pass it and you will get all the frame images