mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
check if the default set contact source is valid at creating a new contact
This commit is contained in:
@ -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() {
|
||||||
|
Reference in New Issue
Block a user