Q:

android View animation doesn't working

I tried this code and it just doesn't start the animation. the image i putted on the bitmap doesn't move as it should, it's just stay in it's place.
i didn't get any errors and i didn't change the XML file. 
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.view.View;

public class game  extends View{
    int x = 0;//locations
    int y = 0;
    public game(Context context) {
        super(context); 
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Bitmap ball = BitmapFactory.decodeResource(getResources(), R.drawable.t);
        super.onDraw(canvas);
        Rect rectangle = new Rect();
        rectangle.set(0, 0, canvas.getWidth(), canvas.getHeight());
        Paint red = new Paint();
        red.setColor(Color.RED);
        red.setStyle(Paint.Style.FILL);
        canvas.drawRect(rectangle, red);
        if(x < canvas.getHeight())
            x =+ 10;
        else
            x = 0;
        if(y < canvas.getWidth())
            y =+ 10;
        else 
            y = 0;
        Paint a = new Paint();
        canvas.drawBitmap(ball, x, y, a);
        invalidate();//repeat the code 
    }

}

A:

Try this - 
 Paint a= new Paint();
 a.setAntiAlias(true);
 a.setFilterBitmap(true);
 a.setDither(true);

 canvas.drawBitmap(ball, x, y, a);

