Android(安卓)调用另一个应用(app)中的Activity
16lz
2021-01-26
在同一个应用中,大家都熟悉用Intent在Activity之间跳转。那么Intent能否再两个应用之间跳转呢。答案是肯定的。
在Android2.0 后的做如下:app1 org.freedom.app1.HelloActivity app2 org.freedom.app2.TestActivity 如何在app2的TestActivity调用app1的HelloActivity呢?
首先在app1的 AndroidManifest.xml中 HelloActivity声明中加入如下内容: <intent-filter>
<action android:name=""/>
</intent-filter>
然后就可以调用了 TestActivity 中调用代码如下: Intent Intent = new Intent(); intent.setClassName("org.freedom.app1", "org.freedom.app1.HelloActivity"); startActivity(intent);
更多相关文章
- android 启动自动调用自己创建的脚本(应用程序)
- android 休眠与唤醒II
- Android(安卓)Camera2 Hal3(二)startPreview预览过程
- android GoogleMap定位(一)
- 如何控制android中ImageView的位置
- 计算Android(安卓)App占用的各种空间大小
- No resource found that matches the given name (at 'xxx' with
- android基础知识06:intent和intentfilter
- Android(安卓)8.0以上 竖屏到横屏 返回时出现错误的解决办法