<p dir="auto">Glide Version: &gt;4.8.0</p>
<p dir="auto">Integration libraries: None<br>
Device/Android Version: Any<br>
Issue details / Repro steps / Use case background:</p>
<p dir="auto">How do we get a context to a custom ModelLoader in Glide 4? We should not store the context in the ModelLoaderFactory</p>
<p dir="auto">Registry requires a factory:</p>
<p dir="auto">public void registerComponents(<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nonnull/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nonnull">@nonnull</a> Context context, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nonnull/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nonnull">@nonnull</a> Glide glide, Registry registry) {<br>
registry.append(MetadataTest.class, InputStream.class, new TestModelLoaderFactory(context));<br>
}<br>
but build can't take a context:</p>
<p dir="auto">public ModelLoader&lt;MetadataTest, InputStream&gt; build(<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nonnull/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nonnull">@nonnull</a> MultiModelLoaderFactory multiFactory) {<br>
return new TestModelLoader(context); &lt;-- no context here<br>
}<br>
So there's no context during the ModelLoader creation:</p>
<p dir="auto">The docs clearly mention storing a context in a ModelLoader not ModelLoaderFactory, but I can't see how one is possible without the other.</p>
<p dir="auto">I suspect I'm somehow missing something trivial, but I've hunted through the docs and issues.  How do we get a context to a <code class="notranslate">ModelLoader</code> built via the <code class="notranslate">ModelLoaderFactory</code>?  We can't store the context in the factory, so there must be some way to inject it into the <code class="notranslate">build</code>?</p>