Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I am new to developing live wallpaper i want to move background sky continuously for that i have use below code but it is work smoothly in 2.3device but below and above 2.3 devise it getting jerks please help me to solve this problem.

private int mBGFarMoveX = 0;
private int mBGNearMoveX = 0;

mBGFarMoveX = mBGFarMoveX - 2;

// decrement the near background
mBGNearMoveX = mBGNearMoveX - 4;

if (newFarX <= 0) {
mBGFarMoveX = 0;

canvas.drawBitmap(backGround, mBGFarMoveX, 0, null);
canvas.drawBitmap(bmp, 20,20,null);

}
else {
// need to draw original and wrap

canvas.drawBitmap(backGround, mBGFarMoveX, 0, null);
canvas.drawBitmap(backGround, newFarX, 0, null);
canvas.drawBitmap(bmp, 20, 20,null);
}

and i have use invalidate method in ondraw(canvas);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900