This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Launch another Android app using an intent with a package name, with a fix for Android 13 and later. Java code. | |
public void startNewActivity(Context context, String packageName) { | |
Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName); | |
//Fix for Android 13 | |
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { | |
intent.addCategory(Intent.CATEGORY_LAUNCHER); | |
} | |
if (intent == null) { |