'How to inflate layout not from R.layout?

Can I send layout to the app or open layout file in android application and inflate it, like it was builded with the application?



Solution 1:[1]

thats not possible according to DOC

For performance reasons, view inflation relies heavily on pre-processing of XML files that is done at build time. Therefore, it is not currently possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; it only works with an XmlPullParser returned from a compiled resource (R.something file.)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 snachmsm