A (175)

(Tuis.) #1

378 CHAPTER 10: Android Animation: Making Your UI Designs Move



  1. To instantiate this spaceShipAnim Animation object, you will use the
    .loadAnimation( ) method, rather than the findViewById( ) method.
    The .loadAnimation( ) method is in the AnimationUtils class, and is called
    off of this class using dot notation, using the method call AnimationUtils.
    loadAnimation( ), as seen in Figure 10-17.


Figure 10-17. Instantiate the spaceShipAnim Animation object inside of onCreate( ) using a loadAnimation( ) method


Figure 10-16. Declare an Animation object and name it spaceShipAnim at the top of your MainActivity.java file

Free download pdf