Unverified Commit c69d1368 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge pull request #2039 from divyanshub024/fix-2038

[FIX] Show only email apps for sending email
parents db36166e 240979ab
...@@ -2,6 +2,7 @@ package chat.rocket.android.settings.ui ...@@ -2,6 +2,7 @@ package chat.rocket.android.settings.ui
import android.content.ActivityNotFoundException import android.content.ActivityNotFoundException
import android.content.Intent import android.content.Intent
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
...@@ -128,11 +129,12 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen ...@@ -128,11 +129,12 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen
} }
private fun contactSupport() { private fun contactSupport() {
with(Intent(Intent.ACTION_SEND)) { val uriText = "mailto:${"support@rocket.chat"}" +
type = "message/rfc822" "?subject=" + Uri.encode(getString(R.string.msg_android_app_support)) +
putExtra(Intent.EXTRA_EMAIL, arrayOf("support@rocket.chat")) "&body=" + Uri.encode(getDeviceAndAppInformation())
putExtra(Intent.EXTRA_SUBJECT, getString(R.string.msg_android_app_support))
putExtra(Intent.EXTRA_TEXT, getDeviceAndAppInformation()) with(Intent(Intent.ACTION_SENDTO)) {
data = uriText.toUri()
try { try {
startActivity(Intent.createChooser(this, getString(R.string.msg_send_email))) startActivity(Intent.createChooser(this, getString(R.string.msg_send_email)))
} catch (ex: ActivityNotFoundException) { } catch (ex: ActivityNotFoundException) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment