You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用getLaunchIntentForPackage启动其他应用时缺失启动页的问题求助

getLaunchIntentForPackage启动其他应用时缺失启动页的问题求助

我现在在自己的应用里用getLaunchIntentForPackage来启动其他应用,代码是这样的:

val launchIntent: Intent? = context.packageManager.getLaunchIntentForPackage(id)
context.startActivity(launchIntent)

整体功能是正常的,但有个困扰我的问题——启动其他应用时看不到它们的启动页。比如启动汉堡王(Burger King)的应用时,只会显示一片白屏,但从系统桌面/应用图标正常启动的话,就能看到带有汉堡王图标的启动页。

拿汉堡王的例子来说,我传入的id是de.burgerking.kingfinder,获取到的Intent信息如下:

Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=de.burgerking.kingfinder cmp=de.burgerking.kingfinder/rbi.android.app.Launcher }

有没有人知道为什么会出现这种启动页不显示的情况,以及该怎么解决这个问题呢?

备注:内容来源于stack exchange,提问作者Stefan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 10:03:07