0

I got an AnimationDrawable like so:

 AnimationDrawable ani = new AnimationDrawable();       
        ani.addFrame(first, duration);
        ani.addFrame(second, duration);
        ani.addFrame(third, duration);
        ani.setOneShot(true);

And started like so:

ani.start();

I was wondering if it is possible to start directly, at lets say the second frame. Are there any ways of doing this? I need it for a game where I want to be able to resume the exact frame as when I hit my pause button calling:

ani.stop();

For now it starts the entire animation again after resumeing from "pause mode".

Magakahn
  • 498
  • 9
  • 31

1 Answers1

0

When animtaion stop,use this method : ani.selectDrawable(index);

muyiou
  • 679
  • 5
  • 15