For almost all views it is possible to create them using the constructor with just the Context parameter. For the class Button it is not possible because of the row 37:
Can you check at this row if attrs is null? This would allow us to create buttons programmatically...
RelativeLayout -> CustomView -> Button
in this queue only the Button class (and all its sons) has the problem because of the get on attrs. Its parents allow to create objects with attrs set to null
For almost all views it is possible to create them using the constructor with just the Context parameter. For the class
Button
it is not possible because of the row 37:clickAfterRipple = attrs.getAttributeBooleanValue(MATERIALDESIGNXML,"animate", true);
Can you check at this row if
attrs
isnull
? This would allow us to create buttons programmatically...RelativeLayout
->CustomView
->Button
in this queue only the Button class (and all its sons) has the problem because of the get on
attrs
. Its parents allow to create objects with attrs set tonull