Skip to content

Commit

Permalink
fix IsActive
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed May 11, 2024
1 parent 64bf92d commit 5804820
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions MonoGame.Framework/Platform/Android/AndroidGameWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal static AndroidGameWindow FromHandle(IntPtr windowHandle)

private AndroidGameActivity _activity;
private readonly Game _game;
private bool _isActivated = true;
private bool _isActivated = false;
MediaState _mediaPlayer_PrevState = MediaState.Stopped;

private Rectangle _clientBounds;
Expand Down Expand Up @@ -115,10 +115,10 @@ void _activity_Resumed(object sender, EventArgs e)

void _activity_Paused(object sender, EventArgs e)
{
if (!_isActivated)
if (_isActivated)
{
_isActivated = true;
OnActivated();
_isActivated = false;
OnDeactivated();
}

_mediaPlayer_PrevState = MediaPlayer.State;
Expand Down
8 changes: 4 additions & 4 deletions MonoGame.Framework/Platform/Cardboard/AndroidGameWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal static AndroidGameWindow FromHandle(IntPtr windowHandle)

private AndroidGameActivity _activity;
private readonly Game _game;
private bool _isActivated = true;
private bool _isActivated = false;
MediaState _mediaPlayer_PrevState = MediaState.Stopped;

private Rectangle _clientBounds;
Expand Down Expand Up @@ -115,10 +115,10 @@ void _activity_Resumed(object sender, EventArgs e)

void _activity_Paused(object sender, EventArgs e)
{
if (!_isActivated)
if (_isActivated)
{
_isActivated = true;
OnActivated();
_isActivated = false;
OnDeactivated();
}

_mediaPlayer_PrevState = MediaPlayer.State;
Expand Down

0 comments on commit 5804820

Please sign in to comment.