ImageView iv;
Animation ani_0,ani_1;
iv=(ImageView)this.findViewById(R.id.iv);
iv.setTag("toRight");
ani_0 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,0.3f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,0.0f);
ani_1= new TranslateAnimation(
Animation.RELATIVE_TO_SELF,0.3f, Animation.RELATIVE_TO_SELF,0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
ani_0.setInterpolator(new AccelerateDecelerateInterpolator());
ani_0.setDuration(3000);
ani_0.setFillEnabled(true);
ani_0.setFillAfter(true);
ani_0.setAnimationListener(animationListener);
ani_1.setInterpolator(new AccelerateDecelerateInterpolator());
ani_1.setDuration(3000);
ani_1.setFillEnabled(true);
ani_1.setFillAfter(true);
ani_1.setAnimationListener(animationListener);
iv.startAnimation(ani_0);