mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +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,6 +179,8 @@ public class DlgDelegate {
|
||||||
|
|
||||||
private Dialog createNotAgainDialog()
|
private Dialog createNotAgainDialog()
|
||||||
{
|
{
|
||||||
|
Dialog dialog = null;
|
||||||
|
if ( 0 != m_msgID ) {
|
||||||
DialogInterface.OnClickListener lstnr_p =
|
DialogInterface.OnClickListener lstnr_p =
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick( DialogInterface dlg, int item ) {
|
public void onClick( DialogInterface dlg, int item ) {
|
||||||
|
@ -191,19 +193,22 @@ public class DlgDelegate {
|
||||||
DialogInterface.OnClickListener lstnr_n =
|
DialogInterface.OnClickListener lstnr_n =
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick( DialogInterface dlg, int item ) {
|
public void onClick( DialogInterface dlg, int item ) {
|
||||||
CommonPrefs.setPrefsBoolean( m_activity, m_prefsKey, true );
|
CommonPrefs.setPrefsBoolean( m_activity, m_prefsKey,
|
||||||
|
true );
|
||||||
if ( null != m_proc ) {
|
if ( null != m_proc ) {
|
||||||
m_proc.run();
|
m_proc.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return new AlertDialog.Builder( m_activity )
|
dialog = new AlertDialog.Builder( m_activity )
|
||||||
.setTitle( R.string.newbie_title )
|
.setTitle( R.string.newbie_title )
|
||||||
.setMessage( m_msgID )
|
.setMessage( m_msgID )
|
||||||
.setPositiveButton( R.string.button_ok, lstnr_p )
|
.setPositiveButton( R.string.button_ok, lstnr_p )
|
||||||
.setNegativeButton( R.string.button_notagain, lstnr_n )
|
.setNegativeButton( R.string.button_notagain, lstnr_n )
|
||||||
.create();
|
.create();
|
||||||
|
}
|
||||||
|
return dialog;
|
||||||
} // createNotAgainDialog
|
} // createNotAgainDialog
|
||||||
|
|
||||||
private Dialog createConfirmThenDialog()
|
private Dialog createConfirmThenDialog()
|
||||||
|
|
Loading…
Reference in a new issue