diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index 51e56b8e2..6010604bb 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -1970,6 +1970,8 @@ public class BoardDelegate extends DelegateBase public void informMissing( boolean isServer, CommsConnTypeSet connTypes, int nDevs, int nMissing ) { + // Log.d( TAG, "informMissing(isServer: %b, nDevs: %d; nMissing: %d", + // isServer, nDevs, nMissing ); m_mySIS.nMissing = nMissing; // will be 0 unless isServer is true m_mySIS.nGuestDevs = nDevs; m_connTypes = connTypes; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java index 94f9d1cf0..6d218706d 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java @@ -33,7 +33,7 @@ import org.eehouse.android.xw4.DlgDelegate.Action; import org.eehouse.android.xw4.Perms23.Perm; import org.eehouse.android.xw4.loc.LocUtils; -class InvitesNeededAlert { +class InvitesNeededAlert implements DialogInterface.OnDismissListener { private static final String TAG = InvitesNeededAlert.class.getSimpleName(); private static InvitesNeededAlert[] sInstance = {null}; @@ -118,13 +118,25 @@ class InvitesNeededAlert { { DbgUtils.assertOnUIThread(); Assert.assertTrueNR( self == sInstance[0] ); - sInstance[0] = null; - if ( null != self.mAlert ) { - InviteChoicesAlert.dismissAny(); - self.mAlert.dismiss(); + if ( self == sInstance[0] ) { + sInstance[0] = null; + if ( null != self.mAlert ) { + InviteChoicesAlert.dismissAny(); + self.mAlert.dismiss(); + } } } + //////////////////////////////////////// + // DialogInterface.OnDismissListener + //////////////////////////////////////// + @Override + public void onDismiss( DialogInterface dialog ) + { + Log.d( TAG, "onDismiss()" ); + close( this ); + } + private InvitesNeededAlert( Callbacks callbacks, State state ) { mState = state; @@ -202,6 +214,7 @@ class InvitesNeededAlert { } ); result = ab.create(); + result.setOnDismissListener( this ); return result; }