Android runOnUiThread not executing
<p>I have this problem. I'm trying to update my <code>TextView</code> from another thread and it's not letting me. </p>

<p>I have tried a bunch of different solutions and none of those didn't seem to help. In my while loop code is printing that "Started new loop" all the time but it's not continuing from that <code>runOnUiThread</code>. </p>

<p>Can anyone help me figure out how to update <code>TextView</code> from another thread?</p>

<pre><code> //second thread
protected void startKakkosThread() {
    Thread t2 = new Thread() {
        public void run() {
            while (true) {
                System.out.println("Started new loop");
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            if(rullaavaNumero &gt;= 0) {
                                rullaavaNumero--;
                                System.out.println(rullaavaNumero);
                                pelaajanPisteetTeksi.setText("" + rullaavaNumero);
                                sleep(1000);
                            }else{
                                rullaavaNumero = 9;
                                System.out.println(rullaavaNumero);
                                pelaajanPisteetTeksi.setText("" + rullaavaNumero);
                                sleep(1000);
                            }
                        }catch (InterruptedException e){
                            e.printStackTrace();
                        }
                    }
                });
            }
        }
    };
    t2.start();
}
</code></pre>