diff --git a/src/Android/AutofillActivity.cs b/src/Android/AutofillActivity.cs index 5e7319411..a2b2d8d41 100644 --- a/src/Android/AutofillActivity.cs +++ b/src/Android/AutofillActivity.cs @@ -8,7 +8,7 @@ namespace Bit.Android { [Activity(Label = "bitwarden", Icon = "@drawable/icon", - LaunchMode = global::Android.Content.PM.LaunchMode.SingleInstance, + LaunchMode = global::Android.Content.PM.LaunchMode.SingleTask, WindowSoftInputMode = SoftInput.StateHidden)] public class AutofillActivity : Activity { diff --git a/src/Android/MainActivity.cs b/src/Android/MainActivity.cs index 35f45d1a2..73392fe13 100644 --- a/src/Android/MainActivity.cs +++ b/src/Android/MainActivity.cs @@ -21,6 +21,7 @@ namespace Bit.Android [Activity(Label = "bitwarden", Icon = "@drawable/icon", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, + LaunchMode = LaunchMode.SingleTask, WindowSoftInputMode = SoftInput.StateHidden)] public class MainActivity : FormsAppCompatActivity { @@ -88,6 +89,7 @@ namespace Bit.Android private void ReturnCredentials(VaultListPageModel.Login login) { + App.App.WasFromAutofillService = true; Intent data = new Intent(); if(login == null) { diff --git a/src/App/App.cs b/src/App/App.cs index a0aec127e..463e83833 100644 --- a/src/App/App.cs +++ b/src/App/App.cs @@ -31,6 +31,8 @@ namespace Bit.App private readonly IGoogleAnalyticsService _googleAnalyticsService; private readonly ILocalizeService _localizeService; + public static bool WasFromAutofillService { get; set; } = false; + public App( string uri, IAuthService authService, @@ -59,6 +61,7 @@ namespace Bit.App SetCulture(); SetStyles(); + WasFromAutofillService = !string.IsNullOrWhiteSpace(_uri); if(authService.IsAuthenticated && _uri != null) { MainPage = new ExtendedNavigationPage(new VaultAutofillListLoginsPage(_uri)); @@ -123,6 +126,12 @@ namespace Bit.App if(Device.OS == TargetPlatform.Android) { + if(WasFromAutofillService) + { + WasFromAutofillService = false; + MainPage = new MainPage(); + + } await CheckLockAsync(false); }