Android invalidate() not updating textView
<p>I'm trying to make a textView update alongside a timed loop. I've tried making it invalidate() every time it loops. This seems to work, but the app crashes when the timer starts.</p>

<p>Here's the loop:</p>

<pre><code>private Timer timer;
private TimerTask timerTask = new TimerTask() {
    @Override
    public void run() {
        thangO += 10;
        textypoo.setText(Integer.toString(thangO));
        textypoo.invalidate();
    }
};

public void start() {
    if (timer != null) {
        return;
    }
    timer = new Timer();
    timer.scheduleAtFixedRate(timerTask, 0, 2000);
}
</code></pre>

<p>Here is the onCreate where I initialize some stuff:</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_second);
    Intent intent = getIntent();
    textypoo = (TextView)findViewById(R.id.textmcview);

}
</code></pre>

<p>Here are 2 onClick method. One that updates the textView whenever I press it, and another that calls the timer:</p>

<pre><code> public void sendthestuff(View view) {
    setContentView(R.layout.activity_second);
    textypoo = (TextView) findViewById(R.id.textmcview);
    thangO++;
    message = Integer.toString(thangO);
    textypoo.setText(message);


}

public void bazinga(View view) {
    start();
}
</code></pre>