简体   繁体   中英

android sdk wait for animation to complete

I am making a simple game and I need the game to pause until a falling animation is completed and then call the AI move function.

Animation animationFalling = AnimationUtils.loadAnimation(this, R.anim.falling);
iv.startAnimation(animationFalling)

then I call the AI's function which does the same command to a different imageview. The problem is that both the images, the players and the AI's are going at the same time. How can I make a small delay to let the first animation finish then start the second?

Thanks

您可以使用AsyncTaskThread来做到这一点。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM