dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

Deep Linking on Android Hides TitleView & ToolbarItems #17967

Open mkshiblu opened 1 year ago

mkshiblu commented 1 year ago

Description

When you open a page containing TitleView or Toolbar Items, if an already running App is opened via deep linking on Android Emulator, the TitleView or the Toolbar disappears.

Initial

TitleView With Red BoxView & one ToolbarItem with the text option

initial

After Deep linking

2  after_command

Steps to Reproduce

  1. Have a Maui Page with TitleView or ToolbarItems or Both
  2. Make sure the MainActivity Can take deep linking IntentFilter
    [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
    [IntentFilter(new[] { Android.Content.Intent.ActionView },
                          AutoVerify = true,
                          Categories = new[]
                          {
                              global::Android.Content.Intent.CategoryDefault,
                              global::Android.Content.Intent.CategoryBrowsable
                          },
                          DataScheme = "DeepLink",
                          DataPath = "TitleIssue"
                        )]
    public class MainActivity : MauiAppCompatActivity
  1. Have The App Running

  2. Use the ADB command to deep link the App to Android Emulator

adb shell am start -d "DeepLink://TitleIssue"

Environment

OS: Windows 11 VisualStudio Version: 17.7.5 Android Emulator: API 33 TargetFrameworks: net7.0-android

Link to public reproduction project repository

https://github.com/mkshiblu/MAUI/tree/main

Version with bug

7.0.92

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 10+ , didn't test other versions

Did you find any workaround?

For toolbar Items, I was able to provide a workaround by removing and re-adding the toolbar items on the OnNavigatioTo method of ContentPage. However, TitleView seems to be not working.

Relevant log output

Log output after the deeplinking -

``
[EGL_emulation] app_time_stats: avg=555.76ms min=0.95ms max=9371.05ms count=17
[Parcel] Expecting binder but got null!
[igationbarissue] Compiler allocated 4533KB to compile void android.view.ViewRootImpl.performTraversals()
[EGL_emulation] app_time_stats: avg=102.45ms min=0.72ms max=1312.70ms count=14
riya-interra commented 10 months ago

I am also facing the same issue in Android if an already running App is opened via deep linking on an Android device, the TitleView or the Toolbar items disappear.

RoiChen001 commented 8 months ago

I can repro it on the latest 17.10.0 p1. repro