Pressing the nav bar's up button in Search Activity now puts you where you were last in tachi

Or creates a new main activity if it doesnt exist
This commit is contained in:
Jay 2020-01-21 18:18:33 -08:00
parent 343fad39b6
commit b7d538f7a6
2 changed files with 3 additions and 13 deletions

View File

@ -139,10 +139,10 @@ open class MainActivity : BaseActivity() {
if (trulyGoBack) return
// Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079
/* if (!isTaskRoot) {
if (!isTaskRoot) {
finish()
return
}*/
}
setContentView(R.layout.main_activity)

View File

@ -70,9 +70,6 @@ class SearchActivity: MainActivity() {
tabAnimator = TabsAnimator(sTabs)
// Set behavior of Navigation drawer
//router.setRoot(controller.withFadeTransaction().tag(id.toString()))
val container: ViewGroup = findViewById(R.id.controller_container)
val content: LinearLayout = findViewById(R.id.main_content)
@ -171,14 +168,7 @@ class SearchActivity: MainActivity() {
private fun Context.popToRoot() {
val intent = Intent(this, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK or Intent
.FLAG_ACTIVITY_REORDER_TO_FRONT
action = when (preferences.startScreen()) {
2 -> SHORTCUT_RECENTLY_READ
3 -> SHORTCUT_RECENTLY_UPDATED
else -> SHORTCUT_LIBRARY
}
flags = Intent.FLAG_ACTIVITY_NEW_TASK
}
startActivity(intent)
finishAfterTransition()