aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-04 10:45:23 -0700
committerAllan Wang <me@allanwang.ca>2017-06-04 10:45:23 -0700
commit4b78e433e1f55b278623c84d1223e42cab875be6 (patch)
tree5c443851d2bd181d63148474be0f7e8bf8f4ff6c /app/src/main/kotlin/com/pitchedapps/frost/utils
parent6fa685433e23ce56286c3fbcae9cf1ef7a1a6e68 (diff)
downloadfrost-4b78e433e1f55b278623c84d1223e42cab875be6.tar.gz
frost-4b78e433e1f55b278623c84d1223e42cab875be6.tar.bz2
frost-4b78e433e1f55b278623c84d1223e42cab875be6.zip
Create activity refresh observable
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt
index 13a8a836..702196bb 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/ContextUtils.kt
@@ -18,9 +18,9 @@ import com.pitchedapps.frost.facebook.FbTab
private const val EXTRA_COOKIES = "extra_cookies"
private const val ARG_URL = "arg_url"
-fun Context.launchNewTask(clazz: Class<out Activity>, cookieList: ArrayList<CookieModel> = arrayListOf()) {
+fun Context.launchNewTask(clazz: Class<out Activity>, cookieList: ArrayList<CookieModel> = arrayListOf(), clearStack: Boolean = true) {
val intent = (Intent(this, clazz))
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
+ if (clearStack) intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putParcelableArrayListExtra(EXTRA_COOKIES, cookieList)
startActivity(intent)
if (this is Activity) finish()