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 efd759670..9f6d84f67 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 implements DialogInterface.OnDismissListener { +class InvitesNeededAlert { private static final String TAG = InvitesNeededAlert.class.getSimpleName(); private DelegateBase mDelegate; @@ -116,16 +116,6 @@ class InvitesNeededAlert implements DialogInterface.OnDismissListener { void onInfoClicked(); } - //////////////////////////////////////// - // DialogInterface.OnDismissListener - //////////////////////////////////////// - @Override - public void onDismiss( DialogInterface dialog ) - { - Log.d( TAG, "onDismiss()" ); - close(); - } - private void close() { DbgUtils.assertOnUIThread(); @@ -209,8 +199,17 @@ class InvitesNeededAlert implements DialogInterface.OnDismissListener { } } ); + alert.setOnCancelListener( new XWDialogFragment.OnCancelListener() { + @Override + public void onCancelled( XWDialogFragment frag ) { + // Log.d( TAG, "onCancelled(frag=%s)", frag ); + callbacks.onCloseClicked(); + close(); + } + } ); + result = ab.create(); - result.setOnDismissListener( this ); + result.setCanceledOnTouchOutside( false ); return result; } }