title: setBackgroundColor() doesn't seem to work
body: <p>I have a <code>RelativeLayout</code> and a <code>Button</code> in my <code>Activity</code> 
  I want to run a code when I click on the <code>Button</code>, so I wrote the following code:</p>
  
  <pre><code>&lt;ImageButton
      android:id="@+id/imageButton1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:src="@drawable/flashlight"
      android:onClick="NightSwitch" /&gt;
  </code></pre>
  
  <p>and then I have the following in my <code>Activity.java</code></p>
  
  <pre><code>public void NightSwitch(View v){
      String One = "1"; //states day
      String Zero = "0"; //states night
  
      int color1 = getResources().getColor(R.color.darkblue);
      int color2 = getResources().getColor(R.color.white);
  
      RelativeLayout rele = (RelativeLayout) findViewById(R.id.RelativeLayout1);
      String state = getString(R.string.night_switch);
  
      if(state.equals(One)){
          rele.setBackgroundColor(color1);
      }
  
      if(state.equals(Zero)){
          rele.setBackgroundColor(color2);
      }
  }
  </code></pre>
  
  <h2>Everything is ok, but <code>setBackgroundColor()</code> does not work and causes a crash. also, how can I debug program in a VB style? Is it even possible?</h2>
  
  <p>Logcat :</p>
  
  <p>01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.view.View$1.onClick(View.java:3838)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.view.View.performClick(View.java:4475)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.view.View$PerformClick.run(View.java:18786)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.os.Handler.handleCallback(Handler.java:730)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.os.Handler.dispatchMessage(Handler.java:92)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.os.Looper.loop(Looper.java:137)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.app.ActivityThread.main(ActivityThread.java:5493)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at java.lang.reflect.Method.invokeNative(Native Method)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at java.lang.reflect.Method.invoke(Method.java:525)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at dalvik.system.NativeStart.main(Native Method)
  01-27 17:38:45.606: E/AndroidRuntime(21427): Caused by: java.lang.reflect.InvocationTargetException
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at java.lang.reflect.Method.invokeNative(Native Method)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at java.lang.reflect.Method.invoke(Method.java:525)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at android.view.View$1.onClick(View.java:3833)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    ... 11 more
  01-27 17:38:45.606: E/AndroidRuntime(21427): Caused by: java.lang.NullPointerException
  01-27 17:38:45.606: E/AndroidRuntime(21427):    at com.example.jonathanlseagull.NumOneActivity.NightSwitch(NumOneActivity.java:46)
  01-27 17:38:45.606: E/AndroidRuntime(21427):    ... 14 more</p>
  
  <p>onCreate();</p>
  
  <pre><code>    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_num_one);
  }
  </code></pre>