从外部活动调用活动 [英] calling activity from external Activity

查看:29
本文介绍了从外部活动调用活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想启动一个未包含在我的原始 .apk 中的活动.我怎么能这样做?另一个 Activity 包含在另一个 .apk 中,它是当前应用程序的先前版本.谢谢,艾尔.

I'd like to start an Activity which is not included in my original .apk. How can I do so? the other Activity is contained in another .apk which is previous version of the current application. Thanks, Eyal.

推荐答案

如果你只知道包名,这个方法很好:

This method is good if you only know the package name:

PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("com.the.other.app");
startActivity(intent);

这篇关于从外部活动调用活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆