Check this weird issue that came up recently on my second go at porting a WP app to Android (no problems with first port months ago). To best illustrate it, I came up with a simple way to reproduce it:
-
create a new solution with a project MonoGame for Android.
-
deploy to device and run it, then press the home button and resume the app again. You will see that all is well and the “Hello from MonoGame” draws fine.
-
now add the following to LoadContent()
x = new Texture2D(graphics.GraphicsDevice, 1, 1);
x.SetData(new[] { Color.Pink });
graphics.GraphicsDevice.DeviceReset += (sender, args) =>
{
x = new Texture2D(graphics.GraphicsDevice, 1, 1);
x.SetData(new[] { Color.Pink });
}; -
add spriteBatch.Draw(x, new Rectangle(10, 100, 300, 300), Color.White); after spritebatch.Begin(). followed by the default monogame hello draw.
-
now launch the app, deactivate it and launch it again (resume)
You will see that both are now black. This issue is new and didnt occur when I used MonoGame months ago for my first port. Please help me fix this issue since its the only thing holding me from release.