A (175)

(Tuis.) #1
CHAPTER 10: Android Animation: Making Your UI Designs Move 383

Figure 10-23. Remove the background image via .setBackground(null) method call and call .startAnimation( ) method


Note If you want to see why I’m using a null (and SDK Level 16) to remove the background image plate,
look ahead at Figure 1 0-2 4 on the left. This will show you what ImageView looks like after you use a
.setImageResource( ) method call, but before you remove the background image, which was used by the
AnimationDrawable object, and which is thus currently installed in the ImageView object, and needs to
be removed when the user clicks on the second ImageButton UI element using this .setBackground(null)
method call.
Free download pdf