I need the code to get android screen resolution in API 10+
I am using monogame android
using Android.App;
_ScreenWidth = Resources.DisplayMetrics.WidthPixels;
This code only works in Actvity1.cs
and not in Game1.cs
, why is that ? I am using Android.App;
statement...
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
ScreenWidth = Resources.DisplayMetrics.WidthPixels;
Game1.Activity = this;
var g = new Game1();
SetContentView(g.Window);
g.Run();
}