Created
April 8, 2011 21:05
-
-
Save aconbere/910742 to your computer and use it in GitHub Desktop.
setRunning symbol not found
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EscapeThread extends Thread { | |
public SurfaceHolder surfaceHolder; | |
public Context context; | |
private boolean running; | |
public EscapeThread(SurfaceHolder holder, Context cont) { | |
this.surfaceHolder = holder; | |
this.context = cont; | |
this.running = false; | |
} | |
public void setRunning(boolean b) { | |
this.running = b; | |
} | |
private void doDraw(Canvas canvas) { | |
// Paint paint = new Paint(); | |
// paint.setAntiAlias(true); | |
// paint.setARGB(255, 0, 255, 0); | |
// | |
// RectF rect = new RectF(100, 100, 100, 100); | |
// | |
// canvas.drawRect(rect, paint); | |
} | |
@Override | |
public void run() { | |
while (running) { | |
Canvas c = null; | |
try { | |
c = surfaceHolder.lockCanvas(null); | |
synchronized (surfaceHolder) { | |
doDraw(c); | |
} | |
} finally { | |
if (c != null) { | |
surfaceHolder.unlockCanvasAndPost(c); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment