aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorpacien2018-03-29 15:11:20 +0200
committerpacien2018-03-29 15:11:20 +0200
commite92c6eca557a75fdd4322637d0f2b26e9e7f7e2a (patch)
treed09cfc66f7854acce4739fb275be38a5cbc8573a /app
parentea4cd3a2a5f90762fc529a3d3fd2d2fbcd0d9cc4 (diff)
downloadtincapp-e92c6eca557a75fdd4322637d0f2b26e9e7f7e2a.tar.gz
Fix back button behaviour on status screen
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt
index 6e74891..64d2d43 100644
--- a/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt
+++ b/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt
@@ -147,7 +147,7 @@ class StartActivity : BaseActivity() {
147 147
148 override fun onResume() { 148 override fun onResume() {
149 super.onResume() 149 super.onResume()
150 if (TincVpnService.isConnected()) openStatusActivity() 150 if (TincVpnService.isConnected()) openStatusActivity(false)
151 broadcastMapper.register() 151 broadcastMapper.register()
152 } 152 }
153 153
@@ -174,6 +174,10 @@ class StartActivity : BaseActivity() {
174 connectDialog?.dismiss() 174 connectDialog?.dismiss()
175 } 175 }
176 176
177 private fun openStatusActivity() = 177 private fun openStatusActivity(transition: Boolean = true) =
178 startActivity(Intent(this, StatusActivity::class.java)) 178 startActivity(
179 Intent(this, StatusActivity::class.java)
180 .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
181 .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
182 .apply { if (!transition) addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION) })
179} 183}