private static void StartBootstrapperCallback(object state) { var activityBase = (SplashScreenActivityBase)state; Exception exception = null; try { if (_bootstrapper == null) { _bootstrapper = activityBase.CreateBootstrapper(); _bootstrapper.Initialize(); //NOTE: to improve startup performance TypeCache <View> .Initialize(null); #if !API8 TypeCache <Fragment> .Initialize(null); #endif } _bootstrapper.Start(activityBase.GetContext()); } catch (Exception e) { Tracer.Error(e.Flatten(true)); exception = e; } finally { activityBase.OnBootstrapperStarted(_bootstrapper, exception); Current = null; _state = DefaultState; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Application.SynchronizationContext.Post(SetContentViewAsync, this); if (Interlocked.Exchange(ref _state, StartedState) == DefaultState) { Current = this; if (_bootstrapper == null) { ThreadPool.QueueUserWorkItem(StartBootstrapperCallback, this); } else { StartBootstrapperCallback(this); } } }