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:
Andy2 2010-12-08 18:52:08 -08:00
parent a1c96b5601
commit d5d81fea5b

View file

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