mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
move setRemoveOnDismiss into delegate, and call it from a dialog
that's been crashing when called from performRestoreInstanceState. The hope is that this will prevent the crash by forcing the dialog to always be recreated. But it may be that I just need to test for m_missingDictNames being null....
This commit is contained in:
parent
83f2882589
commit
a5fd4cef30
4 changed files with 19 additions and 8 deletions
|
@ -75,6 +75,17 @@ public class DlgDelegate {
|
|||
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() );
|
||||
m_activity.removeDialog( id );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
public void onPrepareDialog( int id, Dialog dialog )
|
||||
{
|
||||
AlertDialog ad = (AlertDialog)dialog;
|
||||
|
|
|
@ -124,6 +124,7 @@ public class GamesList extends XWListActivity
|
|||
ab.setNeutralButton( R.string.button_substdict, lstnr );
|
||||
}
|
||||
dialog = ab.create();
|
||||
setRemoveOnDismiss( dialog, id );
|
||||
break;
|
||||
case SHOW_SUBST:
|
||||
m_sameLangDicts =
|
||||
|
|
|
@ -79,15 +79,9 @@ public class XWActivity extends Activity {
|
|||
return dialog;
|
||||
}
|
||||
|
||||
protected void setRemoveOnDismiss( Dialog dialog, final int id )
|
||||
protected void setRemoveOnDismiss( Dialog dialog, int id )
|
||||
{
|
||||
dialog.setOnDismissListener( new DialogInterface.OnDismissListener() {
|
||||
public void onDismiss( DialogInterface di ) {
|
||||
Utils.logf( "%s.onDismiss() called",
|
||||
getClass().getName() );
|
||||
removeDialog( id );
|
||||
}
|
||||
} );
|
||||
m_delegate.setRemoveOnDismiss( dialog, id );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -83,6 +83,11 @@ public class XWListActivity extends ListActivity {
|
|||
return dialog;
|
||||
}
|
||||
|
||||
protected void setRemoveOnDismiss( Dialog dialog, int id )
|
||||
{
|
||||
m_delegate.setRemoveOnDismiss( dialog, id );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPrepareDialog( int id, Dialog dialog )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue