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

Type is not derived from a java type (StartActivity)

$
0
0

Hi friends.

I just have updated to Xamarin Forms 2, but when in my SplashActivity, the method StartActivity() is executed I am getting this error:

Here is the code of my SplashActivity:

[Activity(MainLauncher = true, NoHistory = true, Label = "VisionMobile", Theme = "@style/Theme.Splash", Icon = "@drawable/icon",
    ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Portrait)]
public class SplashActivity : Activity
{
    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);
        Thread.Sleep(1000);
        StartActivity(typeof(MainActivity));
    }
}

And the code of the MainActivity:

[Activity(Icon = "@drawable/icon", Theme = "@android:style/Theme.Holo.Light",
    ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Portrait)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);
        global::Xamarin.Forms.Forms.Init(this, bundle);
        LoadApplication(new App());
    }
}

Some idea about what it is happening?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>