another exception handler

This commit is contained in:
Ellpeck 2020-07-26 15:14:28 +02:00
parent 1f0c10a5e3
commit 4902d49fcd

View file

@ -8,6 +8,7 @@ using Android.Gms.Games;
using Android.OS; using Android.OS;
using Android.Views; using Android.Views;
using Android.Widget; using Android.Widget;
using GameAnalyticsSDK;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Extensions; using MLEM.Extensions;
using MLEM.Misc; using MLEM.Misc;
@ -78,8 +79,12 @@ namespace Android {
protected override void OnActivityResult(int requestCode, Result result, Intent data) { protected override void OnActivityResult(int requestCode, Result result, Intent data) {
base.OnActivityResult(requestCode, result, data); base.OnActivityResult(requestCode, result, data);
// Connect again after logging in to Google Play game services, but only if we haven't tried yet // Connect again after logging in to Google Play game services, but only if we haven't tried yet
if (requestCode == AndroidPlatform.GooglePlayLoginRequest && (int) result != GamesActivityResultCodes.ResultSignInFailed) try {
this.platform.GoogleApi.Connect(); if (requestCode == AndroidPlatform.GooglePlayLoginRequest && (int) result != GamesActivityResultCodes.ResultSignInFailed)
this.platform.GoogleApi.Connect();
} catch (Exception e) {
GameAnalytics.NewErrorEvent(GAErrorSeverity.Error, "OnActivityResult " + e);
}
} }
public override void OnWindowFocusChanged(bool hasFocus) { public override void OnWindowFocusChanged(bool hasFocus) {