title: Android: reuse datepicker
body: <p>I need help with a <code>DatePicker</code>.I followed the tutorial developer/android.com and I created my datepicker. The problem is that I need to use the datepicker in almost all my actiity..
  So, how do I reuse my <code>MyDatePicker</code> class in other activity without having to write all the code each time ? </p>
  
  <p>edit2:</p>
  
  <pre><code>public class MyDatePicker extends DatePicker {
  
                      private EditText mDateDisplay; 
                      private Button mPickDate;
                      private int mYear;
                      private int mMonth;
                      private int mDay;
  
                      static final int DATE_DIALOG_ID = 0;
  
                      public MyDatePicker(Context context, AttributeSet attrs, int defStyle) {
                          super(context, attrs, defStyle);
                                             ///all methods 
  </code></pre>
  
  <p>I do not need only the simple widget in layout, I would need a widget that opens by pressing a button.. this changes my EditText field.
  putting the "address class " in the layout compiler said me: The following classes could not be instantiated: MyDatePicker.</p>