My use case is to switch from App1 to App2 . In App1, I use the packageManager.getPackageInfo() API to check whether the App2 is present or not. When it returns true, I set the intent with intent.setPackage(App2) and trigger the context.startActivity(intent) API. But there are times when context.startActivity(intent) API throws ActivityNotFoundException: App2 is present in the device. The intent has been set in App2 and android:exported is also set to true.
This issue is happening from Android 12. Any inputs be would be highly appreciated!