goshdarnit
Lurker
I am trying to put an image on the screen and change it every five seconds. This is not in an Activity class. Sorry if is a stupid question. This is a huge learning curve for me.
doDraw is a function that draws the image. My problem is that I can't put dot1.doDraw(getResources(), canvas, counter) under public void run() because I cannot pass the parameters to it. (Eclipse gives me errors.) Why doesn't it work if I do the draw statement and then the delay where the called function does nothing?
Code:
public class Panel extends SurfaceView implements SurfaceHolder.Callback {
private Handler mHandler = new Handler();
//stuff
public void doDraw(Canvas canvas) {
int counter = 0;
canvas.drawColor(Color.BLACK);
dot1.doDraw(getResources(), canvas, counter);
mHandler.removeCallbacks(panelDraw);
mHandler.postDelayed(panelDraw, 5000);
}
private Runnable panelDraw = new Runnable() {
public void run() {
}
};
doDraw is a function that draws the image. My problem is that I can't put dot1.doDraw(getResources(), canvas, counter) under public void run() because I cannot pass the parameters to it. (Eclipse gives me errors.) Why doesn't it work if I do the draw statement and then the delay where the called function does nothing?
