Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2058 from xamarin/gh-2023
Browse files Browse the repository at this point in the history
Remove launch adjacent Fixes #2023
  • Loading branch information
jfversluis authored Dec 1, 2022
2 parents df5ddea + 55259a1 commit 77ad3c9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 28 deletions.
4 changes: 0 additions & 4 deletions Xamarin.Essentials/AppInfo/AppInfo.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ static void PlatformShowSettingsUI()

var flags = ActivityFlags.NewTask | ActivityFlags.NoHistory | ActivityFlags.ExcludeFromRecents;

#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif
settingsIntent.SetFlags(flags);

context.StartActivity(settingsIntent);
Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/Email/Email.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ static Task PlatformComposeAsync(EmailMessage message)
{
var intent = CreateIntent(message);
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand Down
10 changes: 2 additions & 8 deletions Xamarin.Essentials/Launcher/Launcher.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ static Task PlatformOpenAsync(Uri uri)
{
var intent = new Intent(Intent.ActionView, AndroidUri.Parse(uri.OriginalString));
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand All @@ -46,10 +43,7 @@ static Task PlatformOpenAsync(OpenFileRequest request)

var chooserIntent = Intent.CreateChooser(intent, request.Title ?? string.Empty);
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

chooserIntent.SetFlags(flags);

Platform.AppContext.StartActivity(chooserIntent);
Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/Map/Map.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ static void StartIntent(string uri)
{
var intent = new Intent(Intent.ActionView, AndroidUri.Parse(uri));
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/PhoneDialer/PhoneDialer.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ static void PlatformOpen(string number)
var dialIntent = ResolveDialIntent(phoneNumber);

var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

dialIntent.SetFlags(flags);

Platform.AppContext.StartActivity(dialIntent);
Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/Sms/Sms.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ static Task PlatformComposeAsync(SmsMessage message)
var intent = CreateIntent(message?.Body, message?.Recipients);

var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand Down

0 comments on commit 77ad3c9

Please sign in to comment.