using Android.App; using Android.Content; using Android.Content.PM; using Android.OS; using Avalonia; using Avalonia.Android; using Avalonia.ReactiveUI; namespace ZymonicApp.Android; [Activity( Label = "ZymonicApp.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] [IntentFilter( new string[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "zymlink", AutoVerify = true)] public class MainActivity : AvaloniaMainActivity { protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) { return base.CustomizeAppBuilder(builder) .WithInterFont() .UseReactiveUI(); } protected override void OnNewIntent(Intent? intent) { if (intent is not null) { var action = intent.Action; var strLink = intent.DataString; if (!string.IsNullOrWhiteSpace(strLink)) { //handle intent routing if (App.Current is not null) { (App.Current as App)!.setDeepLink(strLink, "OnNewIntent"); } } } base.OnNewIntent(intent); } }