use of org.robolectric.res.builder.XmlBlock in project robolectric by robolectric.
the class ShadowAssetManager method loadXmlResourceParser.
public XmlResourceParser loadXmlResourceParser(int resId, String type) throws Resources.NotFoundException {
ResName resName = getResName(resId);
ResName resolvedResName = resolveResName(resName, RuntimeEnvironment.getQualifiers());
if (resolvedResName == null) {
throw new RuntimeException("couldn't resolve " + resName.getFullyQualifiedName());
}
resName = resolvedResName;
XmlBlock block = resourceTable.getXml(resName, RuntimeEnvironment.getQualifiers());
if (block == null) {
throw new Resources.NotFoundException(resName.getFullyQualifiedName());
}
ResourceTable resourceProvider = ResourceIds.isFrameworkResource(resId) ? RuntimeEnvironment.getSystemResourceTable() : RuntimeEnvironment.getCompileTimeResourceTable();
return getXmlResourceParser(resourceProvider, block, resName.packageName);
}
Aggregations