Skip to content

I tried using a handler, but it said ‘cannot resolve symbol”Handler”‘

What do i do to be able to use a handler to update my TextView every 2 secs because right now it comes up with ‘cannot resolve symbol”Handler”‘

int noStart = 20;
int minus = 5;

public void number(View view) {
    final TextView tx = (TextView) findViewById(;

        new Handler().postDelayed(new Runnable() {
            public void run() {
                noStart -= minus;
        }, 2000);


Check your activity imports and add this line to the class:

import android.os.*