handle the SEND_TO intent properly
This commit is contained in:
parent
7f441218d2
commit
e966b7bccd
|
@ -34,6 +34,10 @@ class NewMessageActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun initContacts() {
|
||||
if (isThirdPartyIntent()) {
|
||||
return
|
||||
}
|
||||
|
||||
getAvailableContacts {
|
||||
allContacts = it
|
||||
runOnUiThread {
|
||||
|
@ -63,6 +67,15 @@ class NewMessageActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun isThirdPartyIntent(): Boolean {
|
||||
if (intent.action == Intent.ACTION_SENDTO && intent.dataString != null) {
|
||||
val number = intent.dataString!!.removePrefix("sms:").removePrefix("smsto:").removePrefix("mms").removePrefix("mmsto:").trim()
|
||||
launchThreadActivity(number, "")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private fun setupAdapter(contacts: ArrayList<Contact>) {
|
||||
ContactsAdapter(this, contacts, suggestions_list, null) {
|
||||
hideKeyboard()
|
||||
|
|
Loading…
Reference in New Issue