I have the following code:
Timer micTimer = new Timer();
micTimer.schedule(new TimerTask(){
@Override
public void run(){
Log.v("Timer", "Timer");
}
}, 0, 1000);
Which in theory should every second output a log line Timer Timer, but does not. I understand its probably a better way to use a Handler and use the postDelay() method but this way if working seems adequate enough for my needs. I don’t understand what is wrong with the code.
.
Try this:
—
TimerTask is abstract, so you can’t instantiate it directly – you need to extend it.