Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Resource.Layout.Main

$
0
0

Im trying to get a splash screen working in a Xamarin Forms app for Android. For some reason Resource does not have layout... anyone know why?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Content.PM;
using Java.Lang;
using System.Threading.Tasks;

namespace App5.Droid
{
    [Activity(
    Label = "Icons",
    ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
    MainLauncher = true,
    Theme = "@android:style/Theme.NoTitleBar")]
    public class LaunchActivity : Activity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Main);
        }

        protected override async void OnResume()
        {
            base.OnResume();

            await Task.Run(() => Thread.Sleep(10));
            StartActivity(typeof(MainActivity));
        }
    }
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles