Fix another recycled dialog message by making superclass dismiss

listener adder available and using it.
This commit is contained in:
Andy2 2011-03-05 10:16:29 -08:00
parent 92a726aff3
commit 81e3578dd5
2 changed files with 14 additions and 9 deletions

View file

@ -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:

View file

@ -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 )
{