title: Do I need all three constructors for an Android custom view?
body: <p>When creating a custom view, I have noticed that many people seem to do it like this:</p>
  
  <pre><code>public MyView(Context context) {
    super(context);
    // this constructor used when programmatically creating view
    doAdditionalConstructorWork();
  }
  
  public MyView(Context context, AttributeSet attrs) {
    super(context, attrs);
    // this constructor used when creating view through XML
    doAdditionalConstructorWork();
  }
  
  private void doAdditionalConstructorWork() {
  
    // init variables etc.
  }
  </code></pre>
  
  <p>My first question is, what about the constructor <code>MyView(Context context, AttributeSet attrs, int defStyle)</code>?  I'm not sure where it is used, but I see it in the super class.  Do I need it, and where is it used?</p>
  
  <p>There's <a href="https://stackoverflow.com/questions/9195785/should-i-call-super-or-call-this-for-android-custom-view-constructors">another part to this question</a>.</p>