The plug-in is an apk file that has its own Activity interface and UI display. This section describes how to configure the plug-in to start the Activity and how to start it from the host.
1. Configure the external startup Activity of the plug-in apk (internal activity does not need to be configured)
Different from common apps, The AndroidManifest. xml configuration of the plug-in is invalid in the apkplug framework. We need to configure it in plugin. xml to be recognized by apkplug.
Set the property
Bundle-Activity = xxx. Activity
Only the Activity set as Bundle-activity can be started from the host. Otherwise, an exception of the corresponding class cannot be found.
2. Set multiple external launch activities
If you have multiple activities that need to be started from the outside, you can use, split as shown in
Bundle-Activity = a. B. c, d. e. f, j. q. p
The preceding three activities are configured. You can use Bundle. getBundleActivity () of the plug-in to obtain this string from external startup.
Bundle. getBundleActivity (). split (,) [0] splits the corresponding Activity Class
3. Start activity
There are many ways to start a plug-in activity. The simplest way is to start a native activity.
Intent I = new Intent ();
I. setClassName (mContext, Bundle. getBundleActivity (). split (,) [0]);
// Start with this label
I. addFlags (Intent. FLAG_ACTIVITY_NEW_TASK );
MContext. startActivity (I );
Four plug-in internal activity calls
It can be called in android native mode.
Note that all plug-in activities can only be started in I. addFlags (Intent. FLAG_ACTIVITY_NEW_TASK );