Code: 1. Code of the Activity to be closed: [java] <span style = "font-size: 18px; "> public class TVOffDemo extends Activity {/** Called when the activity is first created. */public void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. main); Button B = (Button) findViewById (R. id. button01); B. setOnClickListener (new OnClickListener () {public void onClick (View v) {Vie W img = findViewById (R. id. layout); img. startAnimation (new TVOffAnimation () ;}}</span> [java] <span style = "font-size: 18px; "> 2. animation implementation class TVOffAnimation </span> [java] view plaincopyprint? <Span style = "font-size: 18px;"> public class TVOffAnimation extends Animation {private int halfWidth; private int halfHeight; public void initialize (int width, int height, int parentWidth, int parentHeight) {super. initialize (width, height, parentWidth, parentHeight); setDuration (500); setFillAfter (true); // Save the center of the View halfWidth = width/2; halfHeight = height/2; setInterpolator (new AccelerateDecelerateInterpolator ();} protected void applyTransformation (float interpolatedTime, Transformation t) {final Matrix matrix = t. getMatrix (); if (interpolatedTime <0.8) {matrix. preScale (1 + 0.625f * interpolatedTime, 1-interpolatedTime/0.8f + 0.01f, halfWidth, halfHeight);} else {matrix. preScale (7.5f * (1-interpolatedTime), 0.01f, halfWidth, halfHeight) ;}}</span>