Android 我想获取特定的imageview id?
我有4个imageview,当单击特定的imageview时,动画加载并移动到下一个活动 这是我的密码Android 我想获取特定的imageview id?,android,animation,imageview,Android,Animation,Imageview,我有4个imageview,当单击特定的imageview时,动画加载并移动到下一个活动 这是我的密码 animation1 = AnimationUtils.loadAnimation(this, R.anim.to_middle); animation1.setAnimationListener(this); animation2 = AnimationUtils.loadAnimation(this, R.anim.from_middle);
animation1 = AnimationUtils.loadAnimation(this, R.anim.to_middle);
animation1.setAnimationListener(this);
animation2 = AnimationUtils.loadAnimation(this, R.anim.from_middle);
animation2.setAnimationListener(this);
saveContact=(ImageView)findViewById(R.id.imgSaveContact);
sendMessage=(ImageView)findViewById(R.id.imgSendMessage);
edit_delete=(ImageView)findViewById(R.id.imgEditDelete);
specificMissCall=(ImageView)findViewById(R.id.imgMissCall);
saveContact.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
v.setEnabled(false);
((ImageView)findViewById(R.id.imgSaveContact)).clearAnimation();
((ImageView)findViewById(R.id.imgSaveContact)).setAnimation(animation1);
((ImageView)findViewById(R.id.imgSaveContact)).startAnimation(animation1);
// TODO Auto-generated method stub
}
});
这是一种方法,
如何在onAnimationEnd中获取特定的imageview id
@Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
if (animation==animation1)
{
if (isBackOfCardShowing)
{
((ImageView)findViewById(R.id.imgSaveContact)).setImageResource(R.drawable.contact);
}
else
{
((ImageView)findViewById(R.id.imgSaveContact)).setImageResource(R.drawable.contact);
}
((ImageView)findViewById(R.id.imgSaveContact)).clearAnimation();
((ImageView)findViewById(R.id.imgSaveContact)).setAnimation(animation2);
((ImageView)findViewById(R.id.imgSaveContact)).startAnimation(animation2);
}
else
{
isBackOfCardShowing=!isBackOfCardShowing;
findViewById(R.id.imgSaveContact).setEnabled(true);
Intent i=new Intent(HomeScreen.this,MainActivity.class);
startActivity(i);
}
}
提前感谢..但在onAnimationEnd中,我如何获得imageview id?我不想至少确认我的答案,因此我将删除它。更多浪费的时间。。。