check if the default set contact source is valid at creating a new contact
This commit is contained in:
parent
4b8ea90443
commit
a9e639d73e
1 changed files with 12 additions and 0 deletions
|
|
@ -601,6 +601,18 @@ class EditContactActivity : ContactActivity() {
|
||||||
getPublicContactSource(contact!!.source) {
|
getPublicContactSource(contact!!.source) {
|
||||||
contact_source.text = it
|
contact_source.text = it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the last used contact source is not available anymore, use the first available one. Could happen at ejecting SIM card
|
||||||
|
ContactsHelper(this).getSaveableContactSources { sources ->
|
||||||
|
val sourceNames = sources.map { it.name }
|
||||||
|
if (!sourceNames.contains(originalContactSource)) {
|
||||||
|
originalContactSource = sourceNames.first()
|
||||||
|
contact?.source = originalContactSource
|
||||||
|
getPublicContactSource(contact!!.source) {
|
||||||
|
contact_source.text = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupTypePickers() {
|
private fun setupTypePickers() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue