mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
when blocking dialogs want to stack, rather than assert, just drop the
second one. I'm not sure this is the right thing to do, but it won't matter except when the assert was firing.
This commit is contained in:
parent
1686f3d9a8
commit
ea205ebf97
1 changed files with 23 additions and 18 deletions
|
@ -1232,29 +1232,34 @@ public class BoardActivity extends XWActivity
|
|||
|
||||
private int waitBlockingDialog( final int dlgID, int cancelResult )
|
||||
{
|
||||
Assert.assertFalse( m_blockingDlgPosted );
|
||||
setBlockingThread();
|
||||
int result = cancelResult;
|
||||
if ( m_blockingDlgPosted ) { // this has been true; dunno why
|
||||
Utils.logf( "waitBlockingDialog: dropping dlgID %d", dlgID );
|
||||
} else {
|
||||
setBlockingThread();
|
||||
|
||||
m_handler.post( new Runnable() {
|
||||
public void run() {
|
||||
showDialog( dlgID ); // crash
|
||||
m_blockingDlgPosted = true;
|
||||
}
|
||||
} );
|
||||
m_handler.post( new Runnable() {
|
||||
public void run() {
|
||||
showDialog( dlgID ); // crash
|
||||
m_blockingDlgPosted = true;
|
||||
}
|
||||
} );
|
||||
|
||||
try {
|
||||
m_forResultWait.acquire();
|
||||
m_blockingDlgPosted = false;
|
||||
} catch ( java.lang.InterruptedException ie ) {
|
||||
Utils.logf( "waitBlockingDialog: got " + ie.toString() );
|
||||
m_resultCode = cancelResult;
|
||||
if ( m_blockingDlgPosted ) {
|
||||
dismissDialog( dlgID );
|
||||
try {
|
||||
m_forResultWait.acquire();
|
||||
m_blockingDlgPosted = false;
|
||||
} catch ( java.lang.InterruptedException ie ) {
|
||||
Utils.logf( "waitBlockingDialog: got " + ie.toString() );
|
||||
m_resultCode = cancelResult;
|
||||
if ( m_blockingDlgPosted ) {
|
||||
dismissDialog( dlgID );
|
||||
m_blockingDlgPosted = false;
|
||||
}
|
||||
}
|
||||
clearBlockingThread();
|
||||
result = m_resultCode;
|
||||
}
|
||||
clearBlockingThread();
|
||||
return m_resultCode;
|
||||
return result;
|
||||
}
|
||||
|
||||
private void nonBlockingDialog( final int dlgID, String txt )
|
||||
|
|
Loading…
Reference in a new issue