I implemented a splash screen as shown below I have a burst of activity as the main launch that launches MainActivity
[Activity(Theme = "@style/MyTheme.Splash",
MainLauncher = true,
Immersive = true,
ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait,
NoHistory = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class SplashActivity : AppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var intent = new Intent(this, typeof(MainActivity));
StartActivity(intent);
}
}
and in my onstart mainactivity, I register all applications and intentional filters, as shown below.
[Activity(Label = "myapp",
Icon = "@drawable/icon",
Theme = "@style/MyTheme",
MainLauncher = false,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] {
Intent.ActionView,
Intent.CategoryDefault,
Intent.CategoryBrowsable
},
DataScheme = "http",
DataHost = "myapp.azurewebsites.net",
DataPathPrefix = "/app/", AutoVerify = true)
]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] {
Intent.ActionView,
Intent.CategoryDefault,
Intent.CategoryBrowsable
},
DataScheme = "https",
DataHost = "myapp.azurewebsites.net",
DataPathPrefix = "/app/", AutoVerify = true)
]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
AndroidAppLinks.Init(this);
LoadApplication(new App());
}
Still fine, everything works, when I click on the link, it redirects to my application and calls OnAppLinkRequestReceived in the App.Xaml.cs application of the forms.
protected override async void OnAppLinkRequestReceived(Uri uri)
{
}
, . , mainactivity splashactivity . , , ,
, OnAppLinkRequestReceived . - , ?
[Activity(Theme = "@style/MyTheme.Splash",
MainLauncher = true,
Immersive = true,
ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait,
NoHistory = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] {
Intent.ActionView,
Intent.CategoryDefault,
Intent.CategoryBrowsable
},
DataScheme = "http",
DataHost = "myapp.azurewebsites.net",
DataPathPrefix = "/app/", AutoVerify = true)
]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] {
Intent.ActionView,
Intent.CategoryDefault,
Intent.CategoryBrowsable
},
DataScheme = "https",
DataHost = "myapp.azurewebsites.net",
DataPathPrefix = "/app/", AutoVerify = true)
]
public class SplashActivity : AppCompatActivity