From 5773466fb6da121461a760fe0441c9d352dd62b8 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Tue, 4 Oct 2011 06:19:06 -0700 Subject: [PATCH] prevent lookup dialogs from coming up before button pressed by not assigning m_words too early. --- .../src/org/eehouse/android/xw4/BoardActivity.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index e94251b13..dade5889d 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -256,19 +256,19 @@ public class BoardActivity extends XWActivity }; ab.setNegativeButton( R.string.button_no, lstnr ); } else if ( DLG_SCORES_BLK == id ) { - m_words = m_wordsWaiting; - if ( null != m_words && m_words.length > 0 ) { + if ( null != m_wordsWaiting && m_wordsWaiting.length > 0 ) { String buttonTxt; - if ( m_words.length == 1 ) { + if ( m_wordsWaiting.length == 1 ) { buttonTxt = Utils.format( this, R.string.button_lookupf, - m_words[0] ); + m_wordsWaiting[0] ); } else { buttonTxt = getString( R.string.button_lookup ); } lstnr = new DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int whichButton ) { + m_words = m_wordsWaiting; lookupWord(); } }; @@ -1228,6 +1228,7 @@ public class BoardActivity extends XWActivity m_dlgBytes = expl; m_dlgTitle = R.string.info_title; m_wordsWaiting = wordsToMWords( words ); + Assert.assertNull( m_words ); Assert.assertTrue( wordCount == m_wordsWaiting.length ); waitBlockingDialog( DLG_SCORES_BLK, 0 ); }