title: Why do we need a 4th constructor for Lollipop?
body: <p>I started a project targeting Android Lollipop (21), and created a custom view. When I generated constructors for the view, I got a new 4th constructor which takes more params than the others.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class FooView extends FrameLayout {
    public FooView(Context context) {
      super(context);
    }
  
    public FooView(Context context, AttributeSet attrs) {
      super(context, attrs);
    }
  
    public FooView(Context context, AttributeSet attrs, int defStyleAttr) {
      super(context, attrs, defStyleAttr);
    }
  
    // This 4th constructor
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public FooView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
      super(context, attrs, defStyleAttr, defStyleRes);
    }
  }
  </code></pre>
  
  <p>My question is, why do we need it? What would happen if I remove this constructor and run the app on Lollipop?</p>