I have a View that inherits from LinearLayout that inflates itself. After it has been created and inflated I wanted the ability to inflate a different layout. However, calling inflate() a second time seems to have no effect. Only if I close the activity and open it again is the state reflected in the UI.
Is it possible to call inflate multiple times to dynamically change the layout?
My inflate code is pretty simple:
layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
layoutInflater.inflate(R.layout.my_layout, this, true);