Timer and TextView
<p>I'm trying to understand how to use a timer.</p>

<p>In my MainActivity.class, inside on create method, i have this code</p>

<pre><code>  Timer  timer = new Timer();
  TimerTask updateM = new GestioneSlide();
  timer.scheduleAtFixedRate(updateM , 1000, 5000); // i want to do a thing every second   for 5 seconds
</code></pre>

<p>then i have another class where i override the method run, and where i want to write something in a texview that is in my MainActivity.class</p>

<pre><code>class GestioneSlide extends TimerTask {


        @Override
       public void run() {
            MainActivity.TextViewName.setText("bla  bla");
            }

    }
</code></pre>

<p>My app crash, if i delete the <code>MainActivity.TextViewName.setText("bla  bla");</code> i have no problem. Probably i can't write in that textview that way
What did i do wrong?</p>
