Pixiview/Gallery.Android/SplashActivity.cs
2021-08-04 10:27:41 +08:00

44 lines
1.2 KiB
C#

using System.Threading.Tasks;
using Android.App;
using Android.Content;
using Android.OS;
using AndroidX.AppCompat.App;
namespace Gallery.Droid
{
[Activity(
MainLauncher = true,
NoHistory = true,
Theme = "@style/MainTheme.Splash",
Name = "org.tsanie.gallery.SplashScreen")]
//[MetaData("android.app.shortcuts", Resource = "@xml/shortcuts")]
public class SplashActivity : AppCompatActivity
{
public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState)
{
base.OnCreate(savedInstanceState, persistentState);
//var intent = new Intent(this, typeof(MainActivity));
//if (Intent != null && Intent.Data != null)
//{
// intent.SetData(Intent.Data);
//}
//StartActivity(intent);
//Finish();
}
protected override void OnResume()
{
base.OnResume();
Task.Run(Start);
}
private void Start()
{
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
}
public override void OnBackPressed() { }
}
}