From 08726093ec00b548b597137d83616b11a5050d3b Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 21 Feb 2018 16:36:00 +0100 Subject: [PATCH] change isFirstResume only if we have the required permissions --- .../simplemobiletools/contacts/activities/MainActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt index c20fb24b..4181dc2c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt @@ -122,12 +122,16 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { if (viewpager.adapter == null) { initFragments() } + contacts_fragment?.initContacts() contacts_fragment?.onActivityResume() favorites_fragment?.initContacts() favorites_fragment?.onActivityResume() } - isFirstResume = false + + if (hasPermission(PERMISSION_WRITE_CONTACTS)) { + isFirstResume = false + } } override fun onPause() {