mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
fix finish() to not exit whole activity in dualpane mode
This commit is contained in:
parent
a7013f3ede
commit
325304d83d
2 changed files with 15 additions and 3 deletions
|
@ -234,9 +234,16 @@ public class DelegateBase implements DlgClickNotify,
|
|||
|
||||
protected void finish()
|
||||
{
|
||||
if ( m_activity instanceof FragActivity ) {
|
||||
((FragActivity)m_activity).finishFragment();
|
||||
} else {
|
||||
boolean handled = false;
|
||||
if ( m_activity instanceof MainActivity ) {
|
||||
MainActivity main = (MainActivity)m_activity;
|
||||
if ( main.inDPMode() ) {
|
||||
main.finishFragment();
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !handled ) {
|
||||
m_activity.finish();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,6 +180,11 @@ public class MainActivity extends XWActivity
|
|||
addFragmentImpl( fragment, extras, this );
|
||||
}
|
||||
|
||||
protected void finishFragment()
|
||||
{
|
||||
getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// FragmentManager.OnBackStackChangedListener
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue