Android ドキュメントXmlPullParser
で説明されている従来のようなものを使用できます。
InputStream yourRemoteLayout = ...;
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser parser = factory.newPullParser();
parser.setInput(yourRemoteLayout, "someEncoding");
AttributeSet attributes = Xml.asAttributeSet(parser);
詳細については、 XmlPullParserのドキュメントで説明されている内容を参照してください。
編集: LayoutInflater#inflate()ドキュメントから:
Important 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.
私が推測しているのはLayoutInflater.Factory2
、Android 自体が前処理されたリソースのみに依存している場合は、独自の実装を作成する必要があるということです。