mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
fix finish() to close a specific fragment
Rather than just pop whatever's on top of the back stack, which might be the alert whose listener called finish(), use saved commit() ids to pop down to the fragment itself. This feels like a risky change, and it's tested only by back-button-dismissing the Wait alert in an unconnected game in BoardDelegate, so needs some bake time.
This commit is contained in:
parent
bb4c5502c8
commit
741dbf2bed
2 changed files with 5 additions and 3 deletions
|
@ -290,7 +290,8 @@ public class DelegateBase implements DlgClickNotify,
|
|||
if ( main.inDPMode() ) {
|
||||
if ( !m_finishCalled ) {
|
||||
m_finishCalled = true;
|
||||
main.finishFragment();
|
||||
XWFragment fragment = (XWFragment)m_delegator;
|
||||
main.finishFragment( fragment.getCommitID() );
|
||||
}
|
||||
handled = true;
|
||||
}
|
||||
|
|
|
@ -298,11 +298,12 @@ public class MainActivity extends XWActivity
|
|||
resultCode, data );
|
||||
}
|
||||
|
||||
protected void finishFragment()
|
||||
protected void finishFragment( int commitID )
|
||||
{
|
||||
// Assert.assertTrue( fragment instanceof XWFragment );
|
||||
// Log.d( TAG, "finishFragment()" );
|
||||
getSupportFragmentManager().popBackStack/*Immediate*/();
|
||||
getSupportFragmentManager()
|
||||
.popBackStack( commitID, FragmentManager.POP_BACK_STACK_INCLUSIVE );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue