adding some null checks
This commit is contained in:
parent
2606456255
commit
d2d5f306e2
|
@ -111,10 +111,10 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
if (viewpager.adapter == null) {
|
||||
initFragments()
|
||||
}
|
||||
contacts_fragment.initContacts()
|
||||
contacts_fragment.onActivityResume()
|
||||
favorites_fragment.initContacts()
|
||||
favorites_fragment.onActivityResume()
|
||||
contacts_fragment?.initContacts()
|
||||
contacts_fragment?.onActivityResume()
|
||||
favorites_fragment?.initContacts()
|
||||
favorites_fragment?.onActivityResume()
|
||||
}
|
||||
isFirstResume = false
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||
}
|
||||
|
||||
fun onSearchOpened() {
|
||||
contactsIgnoringSearch = (fragment_list.adapter as ContactsAdapter).contactItems as ArrayList
|
||||
contactsIgnoringSearch = (fragment_list.adapter as? ContactsAdapter)?.contactItems as ArrayList
|
||||
}
|
||||
|
||||
fun onSearchClosed() {
|
||||
|
|
Loading…
Reference in New Issue