I'm trying to infinitely loop a thread but it keeps running only once. The only solutions I could find was for older version of Java which appear to not be working anymore.

Here is the Activity that starts the loop:

```
public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Thread growCoin = new Thread(new GrowingCoin());
        growCoin.start();
    }
}

```

Class that handles the loop:

```
public class GrowingCoin implements Runnable{
    CoinTracker co = new CoinTracker();
    boolean runGrowLoop = true;

    public void run(){
        try{
            while(runGrowLoop == true){
                co.copper = (int) (co.copper + (co.copper * 0.2));
                MainActivity.coppertv.setText("Copper: " + co.copper);
                Thread.sleep(1000); 
                Log.i("thread debug", "thread sleeping");
            }
        }
        catch(Exception e){

        }
    }
}

```

I'm assuming it has something to do with the CoinTracker class not updating because I've had a similar problem before but if that is the case I do not know how to solve the problem.

Thanks in advance for any solutions/attempts at solving.

EDIT:

I have very little experience with LogCat but I assume the tag System.err means something important so here's everything I got from that tag. I cannot figure out what the error message means:

```
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread     that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6247)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:902)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:4637)
at android.view.View.invalidateInternal(View.java:11690)
at android.view.View.invalidate(View.java:11654)
at android.view.View.invalidate(View.java:11638)
at android.widget.TextView.checkForRelayout(TextView.java:6842)
at android.widget.TextView.setText(TextView.java:4047)
at android.widget.TextView.setText(TextView.java:3905)
at android.widget.TextView.setText(TextView.java:3880)
at me.test.first.GrowingCoin.run(GrowingCoin.java:13)
at java.lang.Thread.run(Thread.java:818)

```