Skip to content

Commit 3c77005

Browse files
committed
back press fix
1 parent 5d48f3c commit 3c77005

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/src/main/java/com/joeracosta/library/activity/FragmentStackActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ abstract class FragmentStackActivity : AppCompatActivity() {
9191
mCurrentFragment = supportFragmentManager.findFragmentByTag(mBackstackTags.peek()) as SimpleFragment
9292
mCurrentFragment?.setAtForefront(true)
9393
mCurrentFragment?.onShown()
94-
return true;
94+
} else {
95+
finish() //have to call finish to finish the activity when there's one fragment left in the stack
9596
}
97+
return true;
9698
}
9799
return false;
98100
}

0 commit comments

Comments
 (0)