title: Stack Overflow error android?
body: <p>My code was running fine but suddenly when i ran the code again, it gave me stack overflow error. Following is my code:HelloDatePickerActivity has already been defined.</p>
  
  <pre><code>HelloDatePickerActivity daten=new HelloDatePickerActivity();
          static final int DATE_DIALOG_ID = 0;    
          Button mPickDate;
          TextView mDateDisplay;
  
          /** Called when the activity is first created. */
          @Override
          public void onCreate(Bundle savedInstanceState) {
  
              super.onCreate(savedInstanceState);
              setContentView(R.layout.offline_screen);
  
      mPickDate=(Button)findViewById(R.id.pickDate);
  
          mPickDate.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  showDialog(DATE_DIALOG_ID); 
              }
          });        
      }
          @Override
          protected Dialog onCreateDialog(int id) {
              switch (id) {
              case DATE_DIALOG_ID:
                  return new DatePickerDialog(this,
                              daten.mDateSetListener,
                              daten.mYear, daten.mMonth, daten.mDay);
              }
              return null;
          }         
  
  }
  </code></pre>
  
  <p>And the Logcat is:</p>
  
  <pre><code>08-26 15:38:50.039: ERROR/AndroidRuntime(585): FATAL EXCEPTION: main
      08-26 15:38:50.039: ERROR/AndroidRuntime(585): java.lang.StackOverflowError
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at java.lang.Thread.currentThread(Thread.java:558)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at java.lang.ThreadLocal.get(ThreadLocal.java:53)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at android.os.Looper.myLooper(Looper.java:157)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at android.os.Handler.&lt;init&gt;(Handler.java:119)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at android.app.Activity.&lt;init&gt;(Activity.java:728)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:14)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerActivity.&lt;init&gt;(HelloDatePickerActivity.java:20)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.ACB_OnlineScreenActivity.&lt;init&gt;(ACB_OnlineScreenActivity.java:23)
      08-26 15:38:50.039: ERROR/AndroidRuntime(585):     at acb.xiynove.HelloDatePickerA
  </code></pre>