android字体闪烁动画,使用线程和Timer实现
public class ActivityMain extends Activity {public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);spark();}private int clo = 0;public void spark() {final TextView touchScreen = (TextView) findViewById(R.id.TextView01);// 获取页面textview对象Timer timer = new Timer();TimerTask taskcc = new TimerTask(){public void run() {runOnUiThread(new Runnable() {public void run() {if (clo == 0) {clo = 1;touchScreen.setTextColor(Color.TRANSPARENT); // 透明} else {if (clo == 1) {clo = 2;touchScreen.setTextColor(Color.RED);} else {clo = 0;touchScreen.setTextColor(Color.GREEN);}}}});}};timer.schedule(taskcc, 1, 300); // 参数分别是delay(多长时间后执行),duration(执行间隔)}}

更多相关文章

  1. Android在onCreate()中获得控件尺寸 (转)
  2. Android(安卓)子线程测试
  3. Android中Message机制的灵活应用
  4. Android启动画面Splash
  5. Android中执行adb命令
  6. android字体闪烁动画(线程)
  7. android如何拿高薪
  8. Android(安卓)重新获取验证码 倒计时
  9. 在Android(安卓)的Camera 预览上执行 Drawing 操作

随机推荐

  1. 浅析Android中的消息机制-解决:Only the o
  2. Android中不同应用间实现SharedPreferenc
  3. 【AS环境】mac上android studio连接安卓
  4. android studio Could not find com.andr
  5. Android中dispatchDraw分析
  6. 《Android开发从零开始》——25.数据存储
  7. 2014.01.21 ——— android 关联android-
  8. android 使用html5作布局文件: webview跟
  9. Android系统配置数据库注释(settings.db)
  10. 使用NetBeans搭建Android开发环境