aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
index ea552b8..8277c1d 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
@@ -80,10 +80,11 @@ class EmailBuilder(val email: String, val subject: String) {
return intent
}
- fun execute(context: Context) {
+ inline fun execute(context: Context, extras: Intent.() -> Unit = {}) {
val intent = getIntent(context)
+ intent.extras()
if (intent.resolveActivity(context.packageManager) != null)
- context.startActivity(Intent.createChooser(intent, context.resources.getString(R.string.kau_send_via)))
+ context.startActivity(Intent.createChooser(intent, context.string(R.string.kau_send_via)))
else
context.toast("Cannot resolve email activity", log = true)
}