-
Notifications
You must be signed in to change notification settings - Fork 505
[Bug] Launcher: Pixel 4 or newer, Android 12 forces split screen when opening files with default app #2023
Comments
Also on Pixel 6. |
Relates to #1817 |
A side effect of that is that deep linking was working fine but now my app crashes when it is opened. On Android 12, the system tries to go with the adjacent option and since that flag is in the intent, the app is always launched in multi window mode and since my app doesn't support that well, it now crashes. When I use StartActivity, without the Launcher, and I don't use the adjacent flag, it works fine. |
Does anyone have a workaround for this? Or do we build a local version of XE and apply changes @NavaJoey suggested ourselves? |
The following worked for me inside the MainApplication public override void StartActivity(Intent intent)
{
// Hack to prevent split screen issues, needs to happen here
// as disabling in attributes causes app to crash
if (Build.VERSION.SdkInt >= BuildVersionCodes.N)
intent.RemoveFlags(ActivityFlags.LaunchAdjacent);
base.StartActivity(intent);
} |
I'm seeing this issue occur when simply doing a ComposeEmail() call too. |
Great that a fix seems on it's way. |
Thanks James and Gerald. You guys are great. Keep up the amazing work! |
Thanks for the fix! Any idea when this will be available? I saw 1.7.4 on the github release page, but it's not yet available on nuget it seems. @jfversluis |
Still waiting for 1.7.4 on nuget.. @jfversluis |
hello friends I found this solution just apply "ResizeableActivity = false," in the MainActivity. https://devblogs.microsoft.com/xamarin/optimizing-android-apps-for-multi-window-mode/ |
I am attaching the problem I had on a Samsung galaxy A13 Android 12, And I am attaching the solution in Xamarin Forms Android. Problem: WhatsApp.Video.2023-02-06.at.10.13.54.mp4Solution: In the Android project, in the file "MainActivity.cs" Result: WhatsApp.Video.2023-02-06.at.10.17.45.mp4I hope they can also solve the problem. greetings friends |
Hello friend, right now I published the solution in the github ISSUE, take a look. greetings
…________________________________
De: Samuel ***@***.***>
Enviado: domingo, 5 de febrero de 2023 20:52
Para: xamarin/Essentials ***@***.***>
Cc: Cr15Denis ***@***.***>; Comment ***@***.***>
Asunto: Re: [xamarin/Essentials] [Bug] Launcher: Pixel 4 or newer, Android 12 forces split screen when opening files with default app (Issue #2023)
hello friends I found this solution just apply "ResizeableActivity = false," in the MainActivity. https://devblogs.microsoft.com/xamarin/optimizing-android-apps-for-multi-window-mode/
I have this in my app:
Samsung galaxy note 20 - with the samsung app even without having launch LaunchAdjacent (forked copy) and removing the flag on start activity it still opens LaunchAdjacent.
does anyone have a workout around. (is this related to the edge panel in Samsung where you can specify to open in split view)
—
Reply to this email directly, view it on GitHub<#2023 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQ3SJDHTIIEI7LTGSXHRSCDWWAHKTANCNFSM52LGVYWA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Thank you, all solved.
…On Tue, 7 Feb 2023, 3:22 am Cr15Denis, ***@***.***> wrote:
I am attaching the problem I had on a Samsung galaxy A13 Android 12, And I
am attaching the solution in Xamarin Forms Android.
Problem:
https://user-images.githubusercontent.com/70722700/217024937-e1b6e148-e6d0-43a5-a10c-a3bdb9e68901.mp4
Solution:
In the Android project, in the file "MainActivity.cs"
[image: solution]
<https://user-images.githubusercontent.com/70722700/217025138-c40a3109-e7c2-4408-ba58-5da877934642.png>
Result:
https://user-images.githubusercontent.com/70722700/217025670-ce964867-f603-4b5d-998c-1065494b27ea.mp4
I hope they can also solve the problem. greetings friends
—
Reply to this email directly, view it on GitHub
<#2023 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGTV2ZJOVCVBZS2BMYXEJTWWEQLZANCNFSM52LGVYWA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
* Added check for reduced accuracy * Adjusted iOS version check to use Xamarin.Essentials DeviceInfo API * Changed DeviceInfo API version check to Platform API version check Co-authored-by: James Montemagno <[email protected]> * Minor code fixes * Update AppInfo.ios.tvos.watchos.macos.cs * Update Xamarin.Essentials.csproj * Bump AspNet.Security.OAuth.Apple to 3.1.8 Bump AspNet.Security.OAuth.Apple to 3.1.8 to resolve GHSA-3893-h8qg-6h5f. * [BULK UPDATE] DocuTune - Rebranding links * Update dependencies * Enable CodeQL * Update README.md * Remove launch adjacent Fixes #2023 * Update App Center dependencies * Update AndroidManifest.xml * Update Xamarin.Essentials.csproj * Update SecureStorage.android.cs * Fix MediaPicker capture methods in Android 13+ Thanks to @Ghostbird in dotnet/maui#12766 * Update MediaPicker.android.cs * Update MediaPicker.android.cs * Update MediaPicker.android.cs * error SA1027: Tabs and spaces should be used correctly * Fix typos in MainThread.cs Typo aysnc -> async * Update FilePicker.xml * Update azure-pipelines.yml * Update README.md * Update README.md * fix share title on iOS * Add compliance to buildpipline * Update azure-pipelines.yml * Update azure-pipelines.yml * Fix * Move files to right place * Remove localization checks * Remove gdn supression file * Renamine devopsnuget.config to nuget.config * Remove references to NuGet.config from cake * Revert "Remove references to NuGet.config from cake" This reverts commit 48fe60b. * Revert "Renamine devopsnuget.config to nuget.config" This reverts commit 953abd1. * Add GDN suppress file * Create NuGet.config * dotnet tool restore first * Revert "dotnet tool restore first" This reverts commit 981b5d7. * Use cake 2.1.0 * Hmm more cake * Fix iOS Device Tests * Revert "Fix iOS Device Tests" This reverts commit 7db9187. * Use Xcode 13.3 * Revert "Use Xcode 13.3" This reverts commit 1138d28. * Use macos-12 for iOS tests * Revert "Revert "Use Xcode 13.3"" This reverts commit 7b5ab9c. * Xcode 14.2 * Try fix iOS tests * Update build.cake * Update build.cake * Bump xharness * Updates for MonoAndroid13.0 * Update dependencies & obsoletes * Set Windows JDK path * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Update build.cake * Remove devopsnuget.config * Add Boots to DeviceTests * Cake.Boots version upgrade * async * Update azure-pipelines.yml * Update dependencies * Xcode update * EnableMultiDex DeviceTests * Update azure-pipelines.yml * Update DeviceTests.Android.csproj * Update build.cake * Update azure-pipelines.yml * Update build.cake * Revert "Update azure-pipelines.yml" This reverts commit f826488. * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Fix Android Emulators * More Android emulator fixes * Update build.cake * Update build.cake * Update build.cake * Update build.cake * Update build.cake * Update build.cake * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Clean up cake file * Reenable API23 tests * Revert "Reenable API23 tests" This reverts commit 22a7e2f. * Reenable API30 tests * Add API33 tests * Update azure-pipelines.yml * Update azure-pipelines.yml * Update build.cake * Update azure-pipelines.yml * Add AndroidManifest entry for high sampling rate * Disable API33 tests * Disable API30 tests for now * Fix failing auth redirect on Android * Update CI version number * Remove wrong Connectivity dispose calls on Android * Make UWP FilePicker FutureAccessList more robust * Add API34 compatibility for networking & battery * Switch to Security v1 template for compliance (#2114) * Update WebAuthenticator Sample app dependencies (#2116) * Update WebAuthenticator Sample app to net8 * Revert "Update WebAuthenticator Sample app to net8" This reverts commit 228ebdd. * Update WebAuth Sample project dependencies * Set APIScan version number * Remove ms.prod = xamarin. Replaced by ms.service = xamarin (#2118) Co-authored-by: Docs Allowlist Management <[email protected]> * Remove ms.technology = xamarin-essentials paired with ms.prod = xamarin. Replaced by ms.subservice = xamarin-essentials paired with ms.service = xamarin (#2117) Co-authored-by: Docs Allowlist Management <[email protected]> Co-authored-by: Gerald Versluis <[email protected]> --------- Co-authored-by: Leon Lucardie <[email protected]> Co-authored-by: leonluc-dev <[email protected]> Co-authored-by: James Montemagno <[email protected]> Co-authored-by: Gerald Versluis <[email protected]> Co-authored-by: Gerald Versluis <[email protected]> Co-authored-by: Martin Costello <[email protected]> Co-authored-by: Alex Buck <[email protected]> Co-authored-by: Jonathan Dick <[email protected]> Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Ivo Snoza <[email protected]> Co-authored-by: dimonovdd <[email protected]> Co-authored-by: learn-build-service-prod[bot] <113403604+learn-build-service-prod[bot]@users.noreply.github.com> Co-authored-by: Docs Allowlist Management <[email protected]>
* Added check for reduced accuracy * Adjusted iOS version check to use Xamarin.Essentials DeviceInfo API * Changed DeviceInfo API version check to Platform API version check Co-authored-by: James Montemagno <[email protected]> * Minor code fixes * Update AppInfo.ios.tvos.watchos.macos.cs * Update Xamarin.Essentials.csproj * Bump AspNet.Security.OAuth.Apple to 3.1.8 Bump AspNet.Security.OAuth.Apple to 3.1.8 to resolve GHSA-3893-h8qg-6h5f. * [BULK UPDATE] DocuTune - Rebranding links * Update dependencies * Enable CodeQL * Update README.md * Remove launch adjacent Fixes #2023 * Update App Center dependencies * Update AndroidManifest.xml * Update Xamarin.Essentials.csproj * Update SecureStorage.android.cs * Fix MediaPicker capture methods in Android 13+ Thanks to @Ghostbird in dotnet/maui#12766 * Update MediaPicker.android.cs * Update MediaPicker.android.cs * Update MediaPicker.android.cs * error SA1027: Tabs and spaces should be used correctly * Fix typos in MainThread.cs Typo aysnc -> async * Update FilePicker.xml * Update azure-pipelines.yml * Update README.md * Update README.md * fix share title on iOS * Add compliance to buildpipline * Update azure-pipelines.yml * Update azure-pipelines.yml * Fix * Move files to right place * Remove localization checks * Remove gdn supression file * Renamine devopsnuget.config to nuget.config * Remove references to NuGet.config from cake * Revert "Remove references to NuGet.config from cake" This reverts commit 48fe60b. * Revert "Renamine devopsnuget.config to nuget.config" This reverts commit 953abd1. * Add GDN suppress file * Create NuGet.config * dotnet tool restore first * Revert "dotnet tool restore first" This reverts commit 981b5d7. * Use cake 2.1.0 * Hmm more cake * Fix iOS Device Tests * Revert "Fix iOS Device Tests" This reverts commit 7db9187. * Use Xcode 13.3 * Revert "Use Xcode 13.3" This reverts commit 1138d28. * Use macos-12 for iOS tests * Revert "Revert "Use Xcode 13.3"" This reverts commit 7b5ab9c. * Xcode 14.2 * Try fix iOS tests * Update build.cake * Update build.cake * Bump xharness * Updates for MonoAndroid13.0 * Update dependencies & obsoletes * Set Windows JDK path * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Update build.cake * Remove devopsnuget.config * Add Boots to DeviceTests * Cake.Boots version upgrade * async * Update azure-pipelines.yml * Update dependencies * Xcode update * EnableMultiDex DeviceTests * Update azure-pipelines.yml * Update DeviceTests.Android.csproj * Update build.cake * Update azure-pipelines.yml * Update build.cake * Revert "Update azure-pipelines.yml" This reverts commit f826488. * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Fix Android Emulators * More Android emulator fixes * Update build.cake * Update build.cake * Update build.cake * Update build.cake * Update build.cake * Update build.cake * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Clean up cake file * Reenable API23 tests * Revert "Reenable API23 tests" This reverts commit 22a7e2f. * Reenable API30 tests * Add API33 tests * Update azure-pipelines.yml * Update azure-pipelines.yml * Update build.cake * Update azure-pipelines.yml * Add AndroidManifest entry for high sampling rate * Disable API33 tests * Disable API30 tests for now * Fix failing auth redirect on Android * Update CI version number * Remove wrong Connectivity dispose calls on Android * Make UWP FilePicker FutureAccessList more robust * Add API34 compatibility for networking & battery * Switch to Security v1 template for compliance (#2114) * Update WebAuthenticator Sample app dependencies (#2116) * Update WebAuthenticator Sample app to net8 * Revert "Update WebAuthenticator Sample app to net8" This reverts commit 228ebdd. * Update WebAuth Sample project dependencies * Set APIScan version number * Remove ms.prod = xamarin. Replaced by ms.service = xamarin (#2118) Co-authored-by: Docs Allowlist Management <[email protected]> * Remove ms.technology = xamarin-essentials paired with ms.prod = xamarin. Replaced by ms.subservice = xamarin-essentials paired with ms.service = xamarin (#2117) Co-authored-by: Docs Allowlist Management <[email protected]> Co-authored-by: Gerald Versluis <[email protected]> * Enable open source docs feedback (#2124) * Enable open source docs feedback. * Fix url. * Fix repo link --------- Co-authored-by: Leon Lucardie <[email protected]> Co-authored-by: leonluc-dev <[email protected]> Co-authored-by: James Montemagno <[email protected]> Co-authored-by: Martin Costello <[email protected]> Co-authored-by: Alex Buck <[email protected]> Co-authored-by: Jonathan Dick <[email protected]> Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Ivo Snoza <[email protected]> Co-authored-by: dimonovdd <[email protected]> Co-authored-by: learn-build-service-prod[bot] <113403604+learn-build-service-prod[bot]@users.noreply.github.com> Co-authored-by: Docs Allowlist Management <[email protected]> Co-authored-by: David Britch <[email protected]>
Description
On Pixel 4 devices or newer with Android 12, if a file is opened using
Launcher.OpenAsync()
the file is opened in split screen mode adjacent to the source app regardless of whetherandroid:resizeableActivity
isfalse
in the manifest file.The issue is that when it goes into split screen mode the source app is reloaded and any in-progress state is lost in that app.
I've narrowed the problem down to the following logic in the
PlatformOpenAsync()
method of theLauncher.android.cs
file:#if __ANDROID_24__ if (Platform.HasApiLevelN) flags |= ActivityFlags.LaunchAdjacent; #endif
Removing this logic fixes the issue.
Steps to Reproduce
Launcher
Expected Behavior
PDF or DOCX file should be opened in a new window and the source app state should remain as before if
android:resizeableActivity
isfalse
Actual Behavior
PDF or DOCX file is open adjacent in split screen mode and the source app is reloaded, losing any in-progress state
Basic Information
The text was updated successfully, but these errors were encountered: