Bitmap top;
int x;
public ViewExample() {
top = BitmapFactory.decodeResource(getResources(), R.drawable.top);
Thread thread = new Thread(){
public void run(){
while(true){
x++;
postInvalidate();
}
}
};
thread.start();
}
@Override
protected void onDraw(Canvas c) {
c.drawBitmap(top, x, 0, null);
}
I try to draw movable bitmap fast , what to do to make draw fast? (it is very slow and not smooth)
if you are using View class to create surface it will be very slow , so use SurfaceView .
Surface view is used for create frequently changing surface .
Go Here for learn more .