mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-03-08 07:25:25 +01:00
check if the default set contact source is valid at creating a new contact
This commit is contained in:
parent
4b8ea90443
commit
a9e639d73e
@ -601,6 +601,18 @@ class EditContactActivity : ContactActivity() {
|
||||
getPublicContactSource(contact!!.source) {
|
||||
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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user