11 Star 57 Fork 13

绝峰网络 / xPlugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
DefaultTplActivity.md 832 Bytes
一键复制 编辑 原始数据 按行查看 历史
wyouflf 提交于 2020-07-23 10:41 . first commit

Activity的使用

1. 在插件的Manifest中注册Activity:

注意: 这种方式注册的Activity不能被外部应用打开, 需要直接被外部应用打开的需要在宿主中注册.

注册示例:

<activity android:theme="myTheme" android:name=".TestActivity"/>

<!-- 或 -->
<activity android:theme="myTheme" android:name=".TestActivity">
    <intent-filter>
        <action android:name="action.xxx.xxx" />
    </intent-filter>
</activity>

3. 打开插件中的 Activity:

Intent intent = new Intent(TestActivity.class);
// intent.setPackage("org.xplugin.demo.main"); // 指定类具体打开的类时, 插件的包名可省略.
startActivity(intent);

Intent intent = new Intent("action.xxx.xxx");
intent.setPackage("org.xplugin.demo.main");
startActivity(intent);
Android
1
https://gitee.com/juefeng_com/xPlugin.git
git@gitee.com:juefeng_com/xPlugin.git
juefeng_com
xPlugin
xPlugin
develop

搜索帮助