Repeatdely Changing App Background Colour : Android
<p>I'm building an app that will blink the screen,
I need to constantly keep changing my android app background colour using </p>

<blockquote>
  <p>setBckgroundColour</p>
</blockquote>

<p>i got the basic background colour change working but when i implement the following code the app crashes</p>

<pre><code>void testthread()
{
    new Thread( new Runnable(){
        @Override
        public void run(){
            Looper.prepare();
            //do work here
            while(true)
            {
            background_White();
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            background_Black();
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            background_White();
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            background_Black();
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            }



        }
    }).start();

}
</code></pre>

<p>the functions background_White and background_Black </p>

<pre><code>    public void background_White() {

    View flashScreen = findViewById(R.id.flashScreen);
    flashScreen.setBackgroundColor(Color.WHITE);

}

public void background_Black() {

    View flashScreen = findViewById(R.id.flashScreen);
    flashScreen.setBackgroundColor(Color.BLACK);
</code></pre>

<p>Can you guys provide me with and insight on how to get my plan working?</p>
