You can use imageswitcher to implement image switching. The text switching animation can also be implemented by a class called textswitcher, which inherits the viewswitcher class.
Viewswitcher
Contains only child textview. Textswitcher is used to animation the labels on the screen. When settext (charsequence) is called, textswitcher uses an animation to erase the current text and display new text content.
Package COM. shao. act; </P> <p> Import Java. util. timer; <br/> Import Java. util. timertask; </P> <p> Import android. app. activity; <br/> Import android. OS. bundle; <br/> Import android. OS. handler; <br/> Import android. OS. message; <br/> Import android. view. view; <br/> Import android. view. view. onclicklistener; <br/> Import android. view. animation. animationutils; <br/> Import android. widget. button; <br/> Import android. wi DGET. textswitcher; <br/> Import android. widget. textview; <br/> Import android. widget. viewswitcher. viewfactory; </P> <p> public class textswitcheractivity extends activity implements viewfactory {<br/>/** called when the activity is first created. */<br/> textswitcher switcher; <br/> handler; <br/> string [] resources ={< br/> "", "is a bodhi tree ,", <br/> "Xin Ru Ming Jing Tai,", <br/> "always clean,", <br/> "do not make dust. "<Br/>}; <br/> private handler mhandler = new handler () {</P> <p> Public void handlemessage (Message MSG) {<br/> switch (MSG. what) {<br/> case 1: <br/> id = next (); // update the id value <br/> updatetext (); // update the display content of textswitcherd; <br/> break; <br/>}< br/>}; <br/> int id = 0; // resource array ID; <br/> @ override <br/> Public void oncreate (bundle savedinstancestate) {<br/> super. oncreate (savedinstancestate); <br/> setcontentview (R. layout. main); <br/> Init (); <br/> timer = new timer (); <br/> timer. scheduleatfixedrate (New mytask (), 1, 3000); // update every 3 seconds <br/>}< br/> private void Init () {<br/> switcher = (textswitcher) findviewbyid (R. id. switcher); <br/> switcher. setfactory (this); <br/> switcher. setinanimation (animationutils. loadanimation (this, android. r. anim. fade_in); <br/> switcher. setoutanimation (animationutils. loadanimation (this, android. r. anim. fade_out); <br/>}< br/> private int next () {</P> <p> int flag = ID + 1; <br/> If (flag> resources. length-1) {<br/> flag = flag-resources.length; <br/>}< br/> return flag; <br/>}< br/> private void updatetext () {<br/> switcher. settext (resources [ID]); <br/>}< br/> @ override <br/> Public View makeview () {<br/> // todo auto-generated method stub <br/> textview TV = new textview (this); <br/> TV. settext (resources [ID]); <br/> return TV; <br/>}< br/> private class mytask extends timertask {<br/> @ override <br/> Public void run () {<br/> message = new message (); <br/> message. what = 1; <br/> mhandler. sendmessage (Message); </P> <p >}< br/>}