title: Programmatically change the layout color of layout
body: <p>I am trying to programatically change the layout color but of a relative layout (tried Linear layout but didn't change), but cannot change it.</p>
  
  <p>Also trying to debug the app doesn't help, there was not message related to my TAG.</p>
  
  <p>the application stood still after layout was colored initially.</p>
  
  <pre><code>package com.test.intentdemo;
  
  import android.app.Activity;
  import android.graphics.Color;
  import android.os.Bundle;
  //import android.os.SystemClock;
  import android.widget.RelativeLayout;
  import android.util.*;
  import java.lang.Thread;
  
  public class intentDemo extends Activity {
      /** Called when the activity is first created. */
      RelativeLayout lLayout;
      public static final String TAG="MyActivity";
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          lLayout = (RelativeLayout) findViewById(R.layout.main);
          if (Log.isLoggable(TAG,0))
          {
              Log.e(TAG,"ERROR BEFORE");
              Log.i(TAG,"INFO BEFORE");
              Log.d(TAG,"DEBUG BEFORE");
  
              lLayout.setBackgroundColor(Color.parseColor("#000000"));
              //SystemClock.sleep(2000);
              try
              {
                  Thread.currentThread();
                  Thread.sleep(2000);
              }
              catch (Exception e)
              {
                  //e.message();
              }
  
              Log.e(TAG,"ERROR AFTER");
              Log.i(TAG,"INFO AFTER");
              Log.d(TAG,"DEBUG AFTER");
          }
      }
  }
  </code></pre>