mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +01:00
Fix another recycled dialog message by making superclass dismiss
listener adder available and using it.
This commit is contained in:
parent
92a726aff3
commit
81e3578dd5
2 changed files with 14 additions and 9 deletions
|
@ -146,6 +146,7 @@ public class BoardActivity extends XWActivity
|
||||||
ab.setNegativeButton( R.string.button_retry, lstnr );
|
ab.setNegativeButton( R.string.button_retry, lstnr );
|
||||||
}
|
}
|
||||||
dialog = ab.create();
|
dialog = ab.create();
|
||||||
|
setRemoveOnDismiss( dialog, id );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DLG_DELETED:
|
case DLG_DELETED:
|
||||||
|
|
|
@ -69,13 +69,19 @@ public class XWActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog( final int id )
|
protected Dialog onCreateDialog( int id )
|
||||||
{
|
{
|
||||||
Utils.logf( "%s.onCreateDialog() called", getClass().getName() );
|
Utils.logf( "%s.onCreateDialog() called", getClass().getName() );
|
||||||
Dialog dialog = m_delegate.onCreateDialog( id );
|
Dialog dialog = m_delegate.onCreateDialog( id );
|
||||||
if ( null != dialog ) {
|
if ( null != dialog ) {
|
||||||
dialog.
|
setRemoveOnDismiss( dialog, id );
|
||||||
setOnDismissListener( new DialogInterface.OnDismissListener() {
|
}
|
||||||
|
return dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setRemoveOnDismiss( Dialog dialog, final int id )
|
||||||
|
{
|
||||||
|
dialog.setOnDismissListener( new DialogInterface.OnDismissListener() {
|
||||||
public void onDismiss( DialogInterface di ) {
|
public void onDismiss( DialogInterface di ) {
|
||||||
Utils.logf( "%s.onDismiss() called",
|
Utils.logf( "%s.onDismiss() called",
|
||||||
getClass().getName() );
|
getClass().getName() );
|
||||||
|
@ -83,8 +89,6 @@ public class XWActivity extends Activity {
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
return dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPrepareDialog( int id, Dialog dialog )
|
protected void onPrepareDialog( int id, Dialog dialog )
|
||||||
|
|
Loading…
Add table
Reference in a new issue