How to start Animation immediately after onCreate?

前端 未结 7 1631
借酒劲吻你
借酒劲吻你 2020-12-15 06:58

I am following http://developer.android.com/guide/topics/graphics/view-animation.html#frame-animation with minor changes. I have decided to make the animation loop and want

7条回答
  •  不思量自难忘°
    2020-12-15 07:43

    You need to give time to UI manager create appropiate resources BEFORE starting animation. Correct pattern is

    a) Create animation object in onCreate.
    b) Start animation object elsewhere.
    

    Don't create and start in same method.

提交回复
热议问题