mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
handle the SEND_TO intent properly
This commit is contained in:
@@ -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()
|
||||||
|
Reference in New Issue
Block a user