Open bruce3x opened 3 weeks ago
I try to add FLAG_ACTIVITY_NEW_TASK
when launch external Intent in my fork version
https://github.com/bruce3x/packages/commit/02dc6d0311f6b6ef243ac733d181cd4ace15c1dd
ActivityInfo activityInfo = launchIntent.resolveActivityInfo(activity.getPackageManager(), 0);
boolean isOurApp =
activityInfo != null && activity.getPackageName().equals(activityInfo.packageName);
if (!isOurApp) {
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
This change is sufficient for our needs. However, for the Flutter framework, a more generalized solution might be necessary to assist different developers.
Hi, do you have any suggestions? Maybe I can submit a PR. @gmackall @huycozy
Can you explain at a high level what your use case is here? I.e., what is the change in behavior, in terms of user experience, that you are trying to effect with this flag?
Use case
I want to launch a Uri in a new Activity task, a typical scenario is launching a third-party URL scheme.
Proposal
Maybe we should add
FLAG_ACTIVITY_NEW_TASK
to Intent when usingLaunchMode.externalApplication
?source code