ImageView flower = (ImageView) findViewById(R.id.flower);
Button btn = (Button)findViewById(R.id.btn);
final Handler handler = new Handler(){
public void handleMessage(Message msg){
if (msg.what == 0x123){
flower.startAnimation(reverse);
}
}
};
bn.setOnClickListener(new OnClickListener(){
public void onClick(View view){
flower.startAnimation(anim);
new Timer().schedule(new TimerTask(){
public void run(){
handler.sendEmptyMessage(0x123);
}
},3500);
}
};
网友评论