|
|
|
@ -2,7 +2,6 @@
|
|
|
|
|
using Android.Content;
|
|
|
|
|
using Android.OS;
|
|
|
|
|
using Android.Support.V7.App;
|
|
|
|
|
using Android.Util;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Demo.Droid
|
|
|
|
@ -10,15 +9,11 @@ namespace Demo.Droid
|
|
|
|
|
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)]
|
|
|
|
|
public class SplashActivity : AppCompatActivity
|
|
|
|
|
{
|
|
|
|
|
private static readonly string TAG = "X:" + typeof(SplashActivity).Name;
|
|
|
|
|
|
|
|
|
|
public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState)
|
|
|
|
|
{
|
|
|
|
|
base.OnCreate(savedInstanceState, persistentState);
|
|
|
|
|
Log.Debug(TAG, "SplashActivity.OnCreate");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Launches the startup task
|
|
|
|
|
protected override void OnResume()
|
|
|
|
|
{
|
|
|
|
|
base.OnResume();
|
|
|
|
@ -26,14 +21,10 @@ namespace Demo.Droid
|
|
|
|
|
startupWork.Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Simulates background work that happens behind the splash screen
|
|
|
|
|
private async void SimulateStartup()
|
|
|
|
|
{
|
|
|
|
|
Log.Debug(TAG, "Performing some startup work that takes a bit of time.");
|
|
|
|
|
await Task.Delay(8000); // Simulate a bit of startup work.
|
|
|
|
|
Log.Debug(TAG, "Startup work is finished - starting MainActivity.");
|
|
|
|
|
await Task.Delay(1);
|
|
|
|
|
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
|
|
|
|
|
}
|
|
|
|
|
public override void OnBackPressed() { }
|
|
|
|
|
}
|
|
|
|
|
}
|