1

I'm trying use a Timertask to change a setText() of a TextView. I want change the text of TextView to each 10 seconds.

How can I do it ?

I'm trying this.

    private void clockTask(){
        timer = new Timer();
        timerTask = new TimerTask() {

            @Override
            public void run() { 
                int count = 0;
                textViewPontuacao.setText(String.valueOf(count += 10));
            }
        };
        timer.scheduleAtFixedRate(timerTask, 100, 1000);
    }
FernandoPaiva
  • 4,410
  • 13
  • 59
  • 118

0 Answers0