Q:

Load a foreign activity into own view?

I'm trying to load the main activity of another app into my own view hierarchy, similar to what can be done with "Fragments".
I've tried:
Context foreignContext = createPackageContext("com.android.calculator2", Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE);
Class<?> foreignClass = foreignContext.getClassLoader().loadClass("com.android.calculator2.Calculator");
Intent intent = new Intent(this, foreignClass);

View view = getLocalActivityManager()
          .startActivity("ReferenceName", intent
          .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
          .getDecorView();
          this.setContentView(view);

This fails with a ClassNotFoundException as it tries to find com.my.app/com.android.calculator2.Calculator (I assume the Local in getLocalActivityManager adds the prefix?)
Is there any way to achieve this? I don't need to interact with the foreign activity or its code, just display it within my own activity, so simply launching it with an intent wouldn't work. I thought this wasn't possible due to security considerations, but if I can (theoretically) access the foreign app's code, it should be possible to somehow run its onCreate method? 
Thanks!

A:

Is there any way to achieve this?

Absolutely not. For starters, it would be a serious security violation.

if I can (theoretically) access the foreign app's code, it should be possible to somehow run its onCreate method?

You can't access the foreign app's code. And, their activity is not in your manifest. 

