我一直在 Application A 中执行一个操作,它将启动另一个 Application R,我正在使用以下代码,但它似乎只在 Android 13 中崩溃,但在以下版本中它工作正常
private fun launchDCApp(respUrl: String)
{
val appIntent: Intent? = context?.packageManager?.getLaunchIntentForPackage(packageId)
appIntent?.addCategory(Intent.ACTION_VIEW)
val activityId = Uri.parse(respUrl).getQueryParameter("activityId")
Session.preferences.accessToken.let {
val constructedUrl = "SchemeNameOfApplicationB://open?userId=" + SharedContext.ssdsRefId + "&activityId=" + activityId + "&authorization=" + it
appIntent?.data = Uri.parse(constructedUrl)
requireContext().startActivity(appIntent)
}
}