mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
hack around IllegalStateException with Wait alert
The pesky thing is back. When app's in the background with an unconnected game open displaying the "resend/wait" alert and the game connects get IllegalStateException because the fragment stack's being modified after onSaveInstanceState() (or, because the dialog fragment, saved as an instance variable in BoardDelegate, dates from an earlier state. Anyway, catching and dropping the exception and elsewhere failing silently to rebuild the alert seems to fix the problem, but the right fix is likely different. I suspect hanging onto that iVar is wrong, and that the dialog should go away when onStop() is called and then be rebuilt later from saved state. But for now, not crashing is good.
This commit is contained in:
parent
fef4db0ee4
commit
ab0764fa5a
2 changed files with 2 additions and 4 deletions
|
@ -2240,9 +2240,8 @@ public class BoardDelegate extends DelegateBase
|
|||
// see....
|
||||
try {
|
||||
m_inviteAlert.dismiss();
|
||||
} catch ( NullPointerException npe ) {
|
||||
Log.ex( TAG, npe );
|
||||
// Assert.assertFalse( BuildConfig.DEBUG );
|
||||
} catch ( NullPointerException | IllegalStateException ex ) {
|
||||
Log.ex( TAG, ex );
|
||||
}
|
||||
m_inviteAlert = null;
|
||||
m_haveStartedShowing = false;
|
||||
|
|
|
@ -55,7 +55,6 @@ abstract class XWDialogFragment extends DialogFragment {
|
|||
|
||||
if ( null != m_buttonMap ) {
|
||||
AlertDialog dialog = (AlertDialog)getDialog();
|
||||
Assert.assertTrue( null != dialog || !BuildConfig.DEBUG );
|
||||
if ( null != dialog) {
|
||||
for ( final int but : m_buttonMap.keySet() ) {
|
||||
// final int fbut = but;
|
||||
|
|
Loading…
Reference in a new issue