diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java index a4f8fe30f..b8b7c4623 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java @@ -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(); } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/MainActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/MainActivity.java index 0cbbc2d14..1d97a6b9f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/MainActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/MainActivity.java @@ -180,6 +180,11 @@ public class MainActivity extends XWActivity addFragmentImpl( fragment, extras, this ); } + protected void finishFragment() + { + getSupportFragmentManager().popBackStack(); + } + ////////////////////////////////////////////////////////////////////// // FragmentManager.OnBackStackChangedListener //////////////////////////////////////////////////////////////////////