When I add the code below Android Studio shows it's not resolved, knowing that I'm targeting API 28
intent.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_TO_ADJACENT);
I tried to use its integer value
intent.setFlags(4096);
It showed me another error that I must used one or more of predefined flags.
You have a typo, it should be Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT, and available for API 24 and above.