Animating (moving) ImageView works one way but not the other
<p>I creating a "Add" button by using sdk, so i wan it to move it to left when i press that "Add" button, and come back to original place when i press again. The problem i have is the button only can go to the left when press, and cannot come back to the original place after i trying to press it again. Does it i having some problem on the if...else function there? any help would appreciate.</p>

<pre><code>public class TestImage2 extends Activity {
/** Called when the activity is first created. */

ImageView image_plus;
ImageView image_subtract;
ImageView image_multiply;
ImageView image_div;

String op;

boolean pergi = false;
final  Animation animation = new TranslateAnimation(0,100,0,0);
final  Animation animation2 = new TranslateAnimation(100,0,0,0);

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    image_plus     = (ImageView)findViewById(R.id.test_image);     
    image_subtract = (ImageView)findViewById(R.id.test_image2);
    image_multiply = (ImageView)findViewById(R.id.test_image3);
    image_div      = (ImageView)findViewById(R.id.test_image4);

    image_plus.setOnClickListener(new OnClickListener(){

        public void onClick(View view) {

                if(pergi == false)
                {

                        animation.setDuration(1000);
                        image_plus.startAnimation(animation);
                        pergi= true;

                        animation.setFillAfter(true); 
                }
                else
                {

                        animation2.setDuration(1000);
                        image_plus.startAnimation(animation2);
                        pergi = false;
                        animation2.setFillAfter(true); 
                }
                }});
</code></pre>
