-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainActivity.cs
29 lines (23 loc) · 1.06 KB
/
MainActivity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Android.App;
using Android.OS;
using Android.Views;
using AndroidX.AppCompat.App;
namespace com.companyname.XamarinBasicSplashScreen
{
[Activity(Label = "@string/app_name", MainLauncher = true)]
public class MainActivity : AppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
AndroidX.Core.SplashScreen.SplashScreen.InstallSplashScreen(this);
base.OnCreate(savedInstanceState);
// Include this if using the Splash Screen API - rotate to Landscape on a device with a notch to see why - with this code commented.
if (Build.VERSION.SdkInt >= BuildVersionCodes.P)
Window.Attributes.LayoutInDisplayCutoutMode = LayoutInDisplayCutoutMode.Default;
// If you want to get a good look at the icon to check it. Don't forget remove from production code
//System.Threading.Thread.Sleep(1000);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.activity_main);
}
}
}