handle the SEND_TO intent properly
This commit is contained in:
parent
7f441218d2
commit
e966b7bccd
1 changed files with 13 additions and 0 deletions
|
|
@ -34,6 +34,10 @@ class NewMessageActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initContacts() {
|
private fun initContacts() {
|
||||||
|
if (isThirdPartyIntent()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
getAvailableContacts {
|
getAvailableContacts {
|
||||||
allContacts = it
|
allContacts = it
|
||||||
runOnUiThread {
|
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>) {
|
private fun setupAdapter(contacts: ArrayList<Contact>) {
|
||||||
ContactsAdapter(this, contacts, suggestions_list, null) {
|
ContactsAdapter(this, contacts, suggestions_list, null) {
|
||||||
hideKeyboard()
|
hideKeyboard()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue