展会信息港展会大全

Android开发教程之--在一个APK中调用另外一个APK的Activity
来源:互联网   发布日期:2016-01-14 10:57:49   浏览:1701次  

导读:步骤如下:一、生成一个要被调用的APK。在其AndroidManifest.xml设置中,与一般的写法大致相同,唯一区别的地方在于,如下:<intent-filter>...

步骤如下:

一、生成一个要被调用的APK。在其AndroidManifest.xml设置中,与一般的写法大致相同,唯一区别的地方在于,如下:

<intent-filter>

<!--

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

-->

<action android:name="test.wlx"/>

<category android:name="android.intent.category.DEFAULT"/>

</intent-filter>

红色的部分,是标示要调用的名字。

二、安装这个要被调用的APK。在应用列表的目录下是看不到这个应用名的。只有在应用删除管理里才能看到它。

三、在另一个项目中调用上述APK。代码如下:

Intent intent = new Intent("test.wlx");

startActivity(intent);

摘自 汪力新的专栏

赞助本站

人工智能实验室

相关热词: android开发 教程

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港