Android liveWallpaper background
Posted
by
Beginer Developer
on Stack Overflow
See other posts from Stack Overflow
or by Beginer Developer
Published on 2011-11-25T13:41:32Z
Indexed on
2011/11/26
1:50 UTC
Read the original article
Hit count: 140
android
|live-wallpaper
How do I scroll the background image on an ACTION_MOVE
event?
Here is my code used to draw the background image:
void drawFrame() {
final SurfaceHolder holder = getSurfaceHolder();
Canvas c = null;
try {
c = holder.lockCanvas();
if (c != null) {
c.drawBitmap(myBg, 0, 0, mPaint);
}
} finally {
if (c != null) holder.unlockCanvasAndPost(c);
}
// Reschedule the next redraw
mHandler.removeCallbacks(mDrawAnim);
if (mVisible && mAnime) {
mHandler.postDelayed(mDrawAnim, 50 );
}
}
© Stack Overflow or respective owner