Commit 0cfb5586 authored by Divyanshu Bhargava's avatar Divyanshu Bhargava

Show only email apps for sending email

parent cf7ffd51
...@@ -29,6 +29,7 @@ import dagger.android.support.AndroidSupportInjection ...@@ -29,6 +29,7 @@ import dagger.android.support.AndroidSupportInjection
import kotlinx.android.synthetic.main.fragment_settings.* import kotlinx.android.synthetic.main.fragment_settings.*
import timber.log.Timber import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
import android.net.Uri
internal const val TAG_SETTINGS_FRAGMENT = "SettingsFragment" internal const val TAG_SETTINGS_FRAGMENT = "SettingsFragment"
...@@ -128,11 +129,13 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen ...@@ -128,11 +129,13 @@ 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)) val uri = Uri.parse(uriText)
putExtra(Intent.EXTRA_TEXT, getDeviceAndAppInformation())
with(Intent(Intent.ACTION_SENDTO)) {
data = uri
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