Merge pull request #225 from irihitech/android

feat: fix android demo start activity issue.
This commit is contained in:
Zhang Dian 2023-07-08 02:44:29 +08:00 committed by GitHub
commit 367aa0a386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 25 deletions

View File

@ -4,9 +4,9 @@ using Avalonia.Android;
namespace Semi.Avalonia.Demo.Android;
[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", Theme = "@style/MyTheme.NoActionBar",
LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
public class MainActivity : AvaloniaMainActivity
[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", MainLauncher = true, Theme = "@style/MyTheme.NoActionBar",
LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App>
{
}

View File

@ -1,22 +0,0 @@
using Android.App;
using Android.Content;
using Avalonia;
using Avalonia.Android;
using Application = Android.App.Application;
namespace Semi.Avalonia.Demo.Android;
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)]
public class SplashActivity: AvaloniaMainActivity<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder);
}
protected override void OnResume()
{
base.OnResume();
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
}
}