Reputation: 765
Is it always a must for extending the View
?
public class MyNewView extends View{
public MyNewView(Context context) {
super(context);
}
}
Upvotes: 0
Views: 70
Reputation: 152887
Yes. Since View
does not have a no-arg constructor *, derived classes must call superclass constructor explicitly.
* there is a package-private no-arg constructor you cannot and should not use
Upvotes: 5