title: My app crashes because I declared a checkbox equal to a checkbox
body: <p>When I open this activity my app crashes and says that it is due to this line of code:</p>
  
  <pre><code>private CheckBox chkWeekly = (CheckBox)findViewById(R.id.alarm_details_repeat_weekly);
  </code></pre>
  
  <p>The layout for alarm_details_repeat_weekly is right here:</p>
  
  <pre><code>&lt;CheckBox
          android:id="@+id/alarm_details_repeat_weekly"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/alarm_details_label_wednesday"
          android:layout_alignBottom="@+id/alarm_details_label_wednesday"
          android:layout_alignParentRight="true"
          android:checked="true" /&gt;
  </code></pre>
  
  <p>Since some people asked, here is the logcat:</p>
  
  <pre><code>         Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
          at android.app.Activity.findViewById(Activity.java:2083)
          at minutemovement.mintemovement.com.minutemovement.AlarmDetailsActivity.&lt;init&gt;(AlarmDetailsActivity.java:28)
          at java.lang.reflect.Constructor.newInstance(Native Method)
          at java.lang.Class.newInstance(Class.java:1572)
          at android.app.Instrumentation.newActivity(Instrumentation.java:1083)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2312)
  </code></pre>
  
  <p>Here is the full code: <a href="http://pastebin.com/EygRhAj4" rel="nofollow">http://pastebin.com/EygRhAj4</a></p>