show a toast message when trying to call someone without phone number

This commit is contained in:
tibbi
2017-12-18 21:46:44 +01:00
parent 2ffcc10c19
commit cac0cc4d37
6 changed files with 11 additions and 1 deletions

View File

@ -163,7 +163,12 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
if (currAdapter == null) {
ContactsAdapter(this, contacts, this, contacts_list) {
if (config.callContact) {
tryStartCall(it as Contact)
val contact = it as Contact
if (contact.phoneNumbers.isNotEmpty()) {
tryStartCall(it)
} else {
toast(R.string.no_phone_number_found)
}
} else {
openContact(it as Contact)
}