public class SplashScreen : Activity { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); LinearLayout linearLayout = new LinearLayout(this); linearLayout.Orientation = Orientation.Vertical; linearLayout.LayoutParameters = new ViewGroup.LayoutParams(500, ViewGroup.LayoutParams.MatchParent); linearLayout.SetBackgroundColor(Android.Graphics.Color.White); SfBusyIndicator busyIndicator = new SfBusyIndicator(this); ImageView imageView = new ImageView(this); imageView.SetImageResource(Resource.Drawable.user); imageView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 50); busyIndicator.AnimationType = Com.Syncfusion.Sfbusyindicator.Enums.AnimationTypes.Ball; busyIndicator.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 100); busyIndicator.TextColor = Color.Red; busyIndicator.IsBusy = true; linearLayout.AddView(imageView); linearLayout.AddView(busyIndicator); SetContentView(linearLayout); Xamarin.Forms.Forms.Init(this, savedInstanceState); System.Threading.ThreadPool.QueueUserWorkItem(o => LoadActivity()); void LoadActivity() { System.Threading.Thread.Sleep(10000); // Simulate a long pause RunOnUiThread(() => StartActivity(typeof(MainActivity))); } } } |