mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
don't return dialog when msgID is 0. This should fix occasional crash
where OS wants to restore a dialog but the message ID has gotten cleared -- via a mechanism I'm not quite clear on.
This commit is contained in:
parent
a1c96b5601
commit
d5d81fea5b
1 changed files with 26 additions and 21 deletions
|
@ -179,31 +179,36 @@ public class DlgDelegate {
|
|||
|
||||
private Dialog createNotAgainDialog()
|
||||
{
|
||||
DialogInterface.OnClickListener lstnr_p =
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int item ) {
|
||||
if ( null != m_proc ) {
|
||||
m_proc.run();
|
||||
Dialog dialog = null;
|
||||
if ( 0 != m_msgID ) {
|
||||
DialogInterface.OnClickListener lstnr_p =
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int item ) {
|
||||
if ( null != m_proc ) {
|
||||
m_proc.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
DialogInterface.OnClickListener lstnr_n =
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int item ) {
|
||||
CommonPrefs.setPrefsBoolean( m_activity, m_prefsKey, true );
|
||||
if ( null != m_proc ) {
|
||||
m_proc.run();
|
||||
DialogInterface.OnClickListener lstnr_n =
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int item ) {
|
||||
CommonPrefs.setPrefsBoolean( m_activity, m_prefsKey,
|
||||
true );
|
||||
if ( null != m_proc ) {
|
||||
m_proc.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
return new AlertDialog.Builder( m_activity )
|
||||
.setTitle( R.string.newbie_title )
|
||||
.setMessage( m_msgID )
|
||||
.setPositiveButton( R.string.button_ok, lstnr_p )
|
||||
.setNegativeButton( R.string.button_notagain, lstnr_n )
|
||||
.create();
|
||||
dialog = new AlertDialog.Builder( m_activity )
|
||||
.setTitle( R.string.newbie_title )
|
||||
.setMessage( m_msgID )
|
||||
.setPositiveButton( R.string.button_ok, lstnr_p )
|
||||
.setNegativeButton( R.string.button_notagain, lstnr_n )
|
||||
.create();
|
||||
}
|
||||
return dialog;
|
||||
} // createNotAgainDialog
|
||||
|
||||
private Dialog createConfirmThenDialog()
|
||||
|
|
Loading…
Reference in a new issue