Android font flashing animation, implemented using thread and Timer
Public class activitymain extends activity {<br/> Public void oncreate (bundle savedinstancestate) {<br/> super. oncreate (savedinstancestate); <br/> setcontentview (R. layout. main); <br/> spark (); <br/>}</P> <p> private int clo = 0; <br/> Public void spark () {<br/> final textview touchscreen = (textview) findviewbyid (R. id. textview01); // obtain the textview object of the page <br/> timer = new timer (); <br/> timertask taskcc = new timertask () {</P> <p> Public void run () {<br/> runonuithread (New runnable () {<br/> Public void run () {<br/> If (clo = 0) {<br/> clo = 1; <br/> touchscreen. settextcolor (color. transparent); // transparent <br/>} else {<br/> If (clo = 1) {<br/> clo = 2; <br/> touchscreen. settextcolor (color. red); <br/>}else {<br/> clo = 0; <br/> touchscreen. settextcolor (color. green); <br/>}< br/>}); <br/>}< br/> }; <br/> timer. schedule (taskcc, 1,300); // The parameters are delay (after which) and duration (Execution interval) <br/>}< br/>}