Skip to content

Commit 188014c

Browse files
committed
adding a crashfix at viewing contact details
1 parent 8970b1f commit 188014c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,12 +638,14 @@ class ViewContactActivity : ContactActivity() {
638638
ensureBackgroundThread {
639639
val actions = getSocialActions(contactId)
640640
runOnUiThread {
641-
ChooseSocialDialog(this@ViewContactActivity, actions) { action ->
642-
Intent(Intent.ACTION_VIEW).apply {
643-
val uri = ContentUris.withAppendedId(ContactsContract.Data.CONTENT_URI, action.dataId)
644-
setDataAndType(uri, action.mimetype)
645-
flags = Intent.FLAG_ACTIVITY_CLEAR_TASK
646-
startActivity(this)
641+
if (!isDestroyed && !isFinishing) {
642+
ChooseSocialDialog(this@ViewContactActivity, actions) { action ->
643+
Intent(Intent.ACTION_VIEW).apply {
644+
val uri = ContentUris.withAppendedId(ContactsContract.Data.CONTENT_URI, action.dataId)
645+
setDataAndType(uri, action.mimetype)
646+
flags = Intent.FLAG_ACTIVITY_CLEAR_TASK
647+
startActivity(this)
648+
}
647649
}
648650
}
649651
}

0 commit comments

Comments
 (0)