Properly start contact view intent
This commit is contained in:
parent
c25cfa7588
commit
51f9662820
4 changed files with 39 additions and 41 deletions
|
|
@ -1286,31 +1286,6 @@ class ThreadActivity : SimpleActivity() {
|
|||
return participants
|
||||
}
|
||||
|
||||
fun startContactDetailsIntent(contact: SimpleContact) {
|
||||
val simpleContacts = "com.simplemobiletools.contacts.pro"
|
||||
val simpleContactsDebug = "com.simplemobiletools.contacts.pro.debug"
|
||||
if (contact.rawId > 1000000 && contact.contactId > 1000000 && contact.rawId == contact.contactId &&
|
||||
(isPackageInstalled(simpleContacts) || isPackageInstalled(simpleContactsDebug))
|
||||
) {
|
||||
Intent().apply {
|
||||
action = Intent.ACTION_VIEW
|
||||
putExtra(CONTACT_ID, contact.rawId)
|
||||
putExtra(IS_PRIVATE, true)
|
||||
setPackage(if (isPackageInstalled(simpleContacts)) simpleContacts else simpleContactsDebug)
|
||||
setDataAndType(ContactsContract.Contacts.CONTENT_LOOKUP_URI, "vnd.android.cursor.dir/person")
|
||||
launchActivityIntent(this)
|
||||
}
|
||||
} else {
|
||||
ensureBackgroundThread {
|
||||
val lookupKey = SimpleContactsHelper(this).getContactLookupKey((contact).rawId.toString())
|
||||
val publicUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey)
|
||||
runOnUiThread {
|
||||
launchViewContactIntent(publicUri)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun saveMMS(mimeType: String, path: String) {
|
||||
hideKeyboard()
|
||||
lastAttachmentUri = path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue