Run Android Activity from c# code

Hi! I need run android activity from c# code. I try do this:

public class Test : Activity

{
   
public void Start()
{
  StartActivity(typeof(MyActivity));
}

}

}

Then from Update() i calling Start(). But i have error: java null pointer exception. When i write this( StartActivity(typeof(MyActivity)) ) into MainActivity.cs all works good
Help me, please

These are general C# on Android questions, so you would be better off asking on the Xamarin forums.

1 Like