ALIGN_PARENT_BOTTOM not working with moving icon in android
<p>I'm new to android, and I can't figure out why this code of mine won't let the icon draw on the bottom of the canvas(screen). what am I doing wrong here? I tried searching for an answer, I have also tried myself, but keeps on breaking the code or just won't work. Thanks.
This is my code:</p>

<pre><code>public class CanvasExample extends Activity {

    private static RectAnim rectAnim;
    private boolean animation;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        Display display = getWindowManager().getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);

        RelativeLayout RL = new RelativeLayout(this);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
        RL.setLayoutParams(params);
        params.addRule(RL.ALIGN_PARENT_BOTTOM);
        rectAnim = new RectAnim(this, size);
        RL.addView(rectAnim);
        setContentView(RL);

    }

    @Override
    protected void onResume() {
        super.onResume();
        animation = true;

        new Thread(new MissileRunnable()).start();
    }

    @Override
    protected void onPause() {
        super.onPause();
        animation = false;
    }

    class MissileRunnable implements Runnable{

        @Override
        public void run() {
            while(animation){
                try {
                    Thread.sleep(150);
                    rectAnim.go();

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

            }
        }
    }

    class RectAnim extends ImageView{

        int PIXEL_MOVEMENT_X = 25;
        int PIXEL_MOVEMENT_Y = 0;
        boolean scale = false;

        private Point size;
        private int nextX, nextY;

        public RectAnim(Context context, Point size) {
            super(context);
            setImageResource(R.drawable.red);
            setLayoutParams(new FrameLayout.LayoutParams(100, 100));
            this.size = size;
        }


        public void go(){

            //handle with nextX movement
            if(getX()+ getWidth()&gt;=size.x || getX()&lt;0){
                PIXEL_MOVEMENT_X*=-1;
                scale = true;
            }

            if(getY()+getHeight() &gt;=size.y || getY()&lt;0){
                PIXEL_MOVEMENT_Y*=-1;
                scale = true;
            }


            incX(PIXEL_MOVEMENT_X);
            incY(PIXEL_MOVEMENT_Y);

            postInvalidate();


        }

        @Override
        public void draw(Canvas canvas) {
            super.draw(canvas);

            setX(nextX);
            setY(nextY);

            if(scale){
                scale = false;
                ObjectAnimator translate = new ObjectAnimator().ofPropertyValuesHolder(this,
                        PropertyValuesHolder.ofFloat(View.SCALE_X,2),
                        PropertyValuesHolder.ofFloat(View.SCALE_Y,2));
                translate.setRepeatMode(ObjectAnimator.REVERSE);
                translate.setRepeatCount(1);
                translate.start();
            }

        }




        public void incX(int value){
            nextX +=value;}
        public void incY(int value){
            nextY +=value;}


    }
} 
</code></pre>