Android 13 在启动其他应用程序时崩溃

问题描述 投票:0回答:0

我一直在 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)
    }
}
android kotlin android-intent start-activity android-13
© www.soinside.com 2019 - 2024. All rights reserved.