Android plugin-apkplug boot plugin from host Activity-06

Source: Internet
Author: User

Plugin is an APK file that has its own activity interface and UI display, this section will explain how to configure the plug-in's startup activity and how to launch it from the host.

A configuration plugin APK's external activation activity (internal activity does not need to be configured)

Unlike the normal app, the plugin androidmanifest.xml configuration is not valid in the Apkplug framework, and we need to configure it in Plugin.xml to be recognized by Apkplug.

The specific setting property is

Bundle-activity= "Xxx.xxx.xxx.Activity"

Only activity that is set to Bundle-activity can be started from the host, otherwise the "exception for the corresponding class cannot be found" is reported

Two setting multiple external startup activity

If you have multiple activity that you need to start from outside, you can use it to split

Bundle-activity= "A.B.C,D.E.F,J.Q.P"

The above configuration has three activity, can be launched externally via the plugin's bundle.getbundleactivity () to get to this string

Bundle.getbundleactivity (). Split (",") [0] splits the corresponding activity class

Three Start activity

There are many ways to start the plugin activity, and the simplest is to start with the native activity startup mode.

Intent i=new Intent ();
I.setclassname (Mcontext, Bundle.getbundleactivity (). Split (",") [0]);

Must start with this label
I.addflags (Intent.flag_activity_new_task);
Mcontext.startactivity (i);

Four plug-in internal activity calls

It can be invoked in native Android mode.

It is important to note that all plug-ins ACTIVITY can only be started with i.addflags (Intent.flag_activity_new_task);

OK, finish!

Official website www.apkplug.com

QQ Exchange Group: 132433459

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.