Skip to content Skip to sidebar Skip to footer

Single View Layout Files: Does Compiler Autowrap With Layout/viewgroup?

If I have a layout file that simply contains a single TextView, I have no problems inflating it from within an activity. However, if I try to inflate a similar layout file that ins

Solution 1:

There is one more constructor I believe you have not provided,

TextView(Context context, AttributeSet attrs, int defStyle)

I've previously had issues inflating and instantiating things without covering all the default constructors, may be adding fuel to the fire here as well. As far as the magic of the auto-wrapping. As far as what it does automatically for you, I can't say however.

Post a Comment for "Single View Layout Files: Does Compiler Autowrap With Layout/viewgroup?"