public void onCreate(Bundle savedInstanceState) {    final Animation animation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible    animation.setDuration(500); // duration - half a second    animation.setInterpolator(new LinearInterpolator()); // do not alter animation rate    animation.setRepeatCount(Animation.INFINITE); // Repeat animation infinitely    animation.setRepeatMode(Animation.REVERSE); // Reverse animation at the end so the button will fade back in    final Button btn = (Button) findViewById(R.id.your_btn);    btn.startAnimation(animation);    btn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(final View view) {            view.clearAnimation()        }    });}
转载自: http://bbs.51cto.com/thread-873259-1.html

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android 支付宝支付密码输入界面
  2. Android "Hell, Testing"
  3. android edittext 显隐密码代码转换两种
  4. [cocos2d-x 学习] Scene(场景)学习
  5. 短信的自动拦截
  6. Android中dip, dp, px,pt, sp之间的区别:
  7. Android点击通知栏,不启动新的activity
  8. android SD卡文件变化监控
  9. Android学习笔记(四)——通过剪切板传递数
  10. Android MVP Demo