android字体闪烁动画(线程)
2013-10-24 12:56
375 查看
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(执行间隔) } }
相关文章推荐
- Android的AndroidManifest.xml android:process元素说明
- android_WallpaperService和Launcher
- android常见bug汇总
- Window环境下搭建android NDK开发环境
- pjsip使用最新源码编译 for android
- Android布局的layout_weight属性
- Android PackageInstaller 安装和卸载
- Android layout_gravity和gravity区别
- 在Android中查看和管理sqlite数据库
- 【Android基础入门〖18〗】新浪微博项目总结
- android虚拟按键
- android 调用 系统视频播放器方法
- Android JSON的应用
- Android源码混淆脚本proguard
- Android(Java):Android的状态栏通知(Notification)
- android 中全屏或取消标题栏
- Android中GridView拖拽的效果【手机icon位置交换】
- android SeekBar属性
- android++websevice++eas
- Android中外部程序调用方法总结