Error When Setting TextView Visibility In Handler
<p>I've been struggling with this issue for a while now, and none of the other solutions I found on stackoverflow have solved my problem.</p>

<p>My UI thread has a handler:</p>

<pre><code>//Global declarations
private UIHandler mHandler;

class UIHandler extends Handler {
    TextView actionTV, objectTV;

    public UIHandler(TextView t1,TextView t2){
        actionTV = t1;
        objectTV = t2;
    }

    @Override
    public void handleMessage(Message msg) {
        // a message is received; update UI text view
        actionTV.setVisibility(View.VISIBLE); //Throws "CalledFromWrongThreadExc"
        objectTV.setVisibility(View.VISIBLE);
        System.out.println("Received Message");
    }
}

    //Inside of onCreate()
    actionText = (TextView) findViewById(R.id.diceAction);
    objectText = (TextView) findViewById(R.id.diceObject);
    mHandler = new UIHandler(actionText,objectText);

    //Inside of onClick
    renderer.rollDice(mHandler);
    actionText.setVisibility(View.GONE);
    objectText.setVisibility(View.GONE);
</code></pre>

<p>And the handler receives a message from my openGL rendering thread. The message passes successfully, as I have tested that out. </p>

<p>I am getting a "CalledFromWrongThread" error on the line "action.setVisibility(View.VISIBLE)". I thought passing the TextView into the Handler in onCreate() would solve the problem, but it hasn't. If someone can point out where I went wrong, I'd greatly appreciate it.</p>
