How to access Layout-specific resources located in an apk which is externally loaded?
<p>I am in the process of developing an application (i.e.: base apk) which is capable downloading, when the need raises, third party apks(i.e.: external apks) from a dedicated server. When that happens the base application (base apk) begins to instantiate each previously downloaded apk (i.e.: external apks) in a way similar to that elaborated <a href="http://stackoverflow.com/questions/6857807/is-it-possible-to-dynamically-load-a-library-at-runtime-from-an-android-applicat">here</a>. The whole process flows smoothly except in cases where those third party apks are designed so as to take advantage of local to themselves resources (i.e.: res/layout/Layout files). In such cases 3rd party apk's code used to access those local resources (e.g.: by trying to inflate a layout as shown below) fails throwing a NULLPointerException(being unable to locate each of them). </p>

<p>I wonder whether or not this is a feasible scenario. If yes (most probably I guess) is there any straight forward solution/work-around that currently I dismiss..?</p>

<pre><code>LayoutInflater.from(this.getContext()).inflate(mypackage.external.apk.R.layout_to_be_loaded, this);
</code></pre>

<p>Thank you!</p>
