Created
January 14, 2020 16:41
-
-
Save Delaire/40c1c563d87d3a68645fc21b5c0a34ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] | |
public class SplashActivity : AppCompatActivity | |
{ | |
static readonly string TAG = "X:" + typeof(SplashActivity).Name; | |
public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState) | |
{ | |
base.OnCreate(savedInstanceState, persistentState); | |
// Create your application here | |
// app Init | |
new App(this); | |
} | |
// Launches the startup task | |
protected override void OnResume() | |
{ | |
base.OnResume(); | |
Task startupWork = new Task(() => { StartupApp(); }); | |
startupWork.Start(); | |
} | |
async void StartupApp() | |
{ | |
Log.Debug(TAG, "Startup work is finished - starting MainActivity."); | |
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