title: Start Activity from Class Loader
body: <p>For my application's manifest, I included activities from a separate apk file I placed on the sdcard. I was wondering if I can use a ClassLoader to load the activities found in the separate apk files and start them?</p>
  
  <p>EDIT: <br>
  So my code would look something like this:</p>
  
  <pre><code>ClassLoader loader = new DexClassLoader("/sdcard/myapp.apk",  getApplicationContext().getFilesDir().getAbsolutePath(), null, AppUI.class.getClassLoader());
  
  Class&lt;?&gt; appClass = loader.loadClass("com.test.myActivity");
  
  Intent myIntent = new Intent(getBaseContext(), appClass);
  myIntent.setClassName("com.test", "com.test.myActivity");
  startActivity(myIntent);
  </code></pre>