问题
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".
回答1:
When animtaion stop,use this method : ani.selectDrawable(index);
来源:https://stackoverflow.com/questions/13867437/start-animationdrawable-at-specific-frame