Use sendEmailIntent extension from commons

This commit is contained in:
Naveen 2022-08-30 19:35:00 +05:30
parent 8f656db1fb
commit 9179125476
3 changed files with 3 additions and 19 deletions

View file

@ -24,19 +24,3 @@ fun Activity.dialNumber(phoneNumber: String, callback: (() -> Unit)? = null) {
}
}
}
fun Activity.sendMail(email: String) {
hideKeyboard()
Intent(Intent.ACTION_SENDTO).apply {
data = Uri.parse("mailto:")
putExtra(Intent.EXTRA_EMAIL, email)
try {
startActivity(this)
} catch (e: ActivityNotFoundException) {
toast(R.string.no_app_found)
} catch (e: Exception) {
showErrorToast(e)
}
}
}