gpt4 book ai didi

安卓 Intent : Start activity using class name from another app that has the same sharedUserId

转载 作者:可可西里 更新时间:2023-11-01 18:53:46 28 4
gpt4 key购买 nike

我所有的应用程序都具有相同的 sharedUserId。我想使用我当前应用程序的类启动另一个应用程序的类。我想使用 intent extras 但我不想使用 intent URL。我也希望不必更改我的目标 Activity 的应用程序的 AndroidManifest。

最佳答案

这很容易,因为您已经设置了 sharedUserId。

Intent res = new Intent();
String mPackage = "com.your.package";
String mClass = ".actYouAreLaunching";
res.setComponent(new ComponentName(mPackage,mPackage+mClass));
startActivity(res);

这就是它的全部。您可以像往常一样添加额外的 Intent 。

关于安卓 Intent : Start activity using class name from another app that has the same sharedUserId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4770847/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com