I created a new MonoGame Android solution in Visual Studio Community on my Mac and I changed nothing in Activity1.cs, but I always get this error message:
LaunchMode = Android.Content.PM.LaunchMode.SingleInstance
The type or namespace name ‘Content’ does not exist in the namespace ‘androtest.Android’ (are you missing an assembly reference?) (CS0234)
What is wrong? What should I change?
Full code of Activity1.cs:
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
namespace androtest.Android
{
[Activity(Label = “androtest.Android”
, MainLauncher = true
, Icon = “@drawable/icon”
, Theme = “@style/Theme.Splash”
, AlwaysRetainTaskState = true
, LaunchMode = Android.Content.PM.LaunchMode.SingleInstance
, ScreenOrientation = ScreenOrientation.FullUser
, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize)]
public class Activity1 : Microsoft.Xna.Framework.AndroidGameActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var g = new Game1();
SetContentView((View)g.Services.GetService(typeof(View)));
g.Run();
}
}
}