SplashActivity
[Activity(Theme = "@style/Theme.Splash", | |
MainLauncher = true, NoHistory = true)] | |
public class SplashActivity : Activity | |
{ | |
protected override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); | |
} | |
protected override void OnResume() | |
{ | |
base.OnResume(); | |
Task startupWork = new Task(() => { SimulateStartup(); }); | |
startupWork.Start(); | |
} | |
// Simulates background work that happens behind the splash screen | |
async void SimulateStartup() | |
{ | |
await Task.Delay(2000); | |
StartActivity(new Intent(Application.Context, typeof(MainActivity))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment