Skip to content

Commit

Permalink
remove _isActivityActive check
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed May 11, 2024
1 parent 734b5bc commit dce9348
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
22 changes: 8 additions & 14 deletions MonoGame.Framework/Platform/Android/AndroidGameActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,11 @@ protected override void OnPause()
{
base.OnPause();

if (_isActivityActive)
{
_isActivityActive = false;
_isActivityActive = false;

var handler = Paused;
if (handler != null)
handler(this, EventArgs.Empty);
}
var handler = Paused;
if (handler != null)
handler(this, EventArgs.Empty);

if (_orientationListener.CanDetectOrientation())
_orientationListener.Disable();
Expand All @@ -88,14 +85,11 @@ protected override void OnResume()
{
base.OnResume();

if (!_isActivityActive)
{
_isActivityActive = true;
_isActivityActive = true;

var handler = Resumed;
if (handler != null)
handler(this, EventArgs.Empty);
}
var handler = Resumed;
if (handler != null)
handler(this, EventArgs.Empty);

if (Game != null)
{
Expand Down
22 changes: 8 additions & 14 deletions MonoGame.Framework/Platform/Cardboard/AndroidGameActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,11 @@ protected override void OnPause()
{
base.OnPause();

if (_isActivityActive)
{
_isActivityActive = false;
_isActivityActive = false;

var handler = Paused;
if (handler != null)
handler(this, EventArgs.Empty);
}
var handler = Paused;
if (handler != null)
handler(this, EventArgs.Empty);

if (_orientationListener.CanDetectOrientation())
_orientationListener.Disable();
Expand All @@ -96,14 +93,11 @@ protected override void OnResume()
{
base.OnResume();

if (!_isActivityActive)
{
_isActivityActive = true;
_isActivityActive = true;

var handler = Resumed;
if (handler != null)
handler(this, EventArgs.Empty);
}
var handler = Resumed;
if (handler != null)
handler(this, EventArgs.Empty);

if (Game != null)
{
Expand Down

0 comments on commit dce9348

Please sign in to comment.