Android多线程之控制animation走走停停(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-26 10:58 点击:次
case STOP_ANIMATION:
icon.clearAnimation();
break;
case START_ANIMATION:
icon.startAnimation(animation);
break;
}
}
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
icon = (ImageView)findViewById(R.id.icon);
btStop = (Button) findViewById(R.id.stop);
btStart = (Button) findViewById(R.id.start);
btStop.setOnClickListener(this);
btStart.setOnClickListener(this);
showAnimation();
icon.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId()){
case R.id.icon:
icon.startAnimation(animation);
break;
case R.id.stop:
freshThrad.interrupt();
break;
case R.id.start:
showAnimation();
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>