diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index 4f87bcaaa..6a5d164dc 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -146,6 +146,7 @@ public class BoardActivity extends XWActivity ab.setNegativeButton( R.string.button_retry, lstnr ); } dialog = ab.create(); + setRemoveOnDismiss( dialog, id ); break; case DLG_DELETED: diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java index 9c3507f43..e0dde2cdd 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java @@ -69,23 +69,27 @@ public class XWActivity extends Activity { } @Override - protected Dialog onCreateDialog( final int id ) + protected Dialog onCreateDialog( int id ) { Utils.logf( "%s.onCreateDialog() called", getClass().getName() ); Dialog dialog = m_delegate.onCreateDialog( id ); if ( null != dialog ) { - dialog. - setOnDismissListener( new DialogInterface.OnDismissListener() { - public void onDismiss( DialogInterface di ) { - Utils.logf( "%s.onDismiss() called", - getClass().getName() ); - removeDialog( id ); - } - } ); + setRemoveOnDismiss( dialog, id ); } return dialog; } + protected void setRemoveOnDismiss( Dialog dialog, final int id ) + { + dialog.setOnDismissListener( new DialogInterface.OnDismissListener() { + public void onDismiss( DialogInterface di ) { + Utils.logf( "%s.onDismiss() called", + getClass().getName() ); + removeDialog( id ); + } + } ); + } + @Override protected void onPrepareDialog( int id, Dialog dialog ) {