diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt index 9c437aef..9500cabf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt @@ -205,22 +205,33 @@ class ViewContactActivity : ContactActivity() { ContactsHelper(this).getContactSources { contactSources = it - getDuplicateContacts { - setupPhoneNumbers() - setupEmails() - setupAddresses() - setupIMs() - setupEvents() - setupWebsites() - setupGroups() - setupContactSources() - setupNotes() - setupOrganization() - updateTextColors(contact_scrollview) + runOnUiThread { + setupContactDetails() + getDuplicateContacts { + setupContactDetails() + } } } } + private fun setupContactDetails() { + if (isFinishing || isDestroyed) { + return + } + + setupPhoneNumbers() + setupEmails() + setupAddresses() + setupIMs() + setupEvents() + setupWebsites() + setupGroups() + setupContactSources() + setupNotes() + setupOrganization() + updateTextColors(contact_scrollview) + } + private fun launchEditContact(contact: Contact) { wasEditLaunched = true editContact(contact)