From f0f07d9c8d0ab01b641e76a5eec805ca681a688a Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 6 Dec 2016 00:04:27 +0100 Subject: [PATCH] fix some crashes related unitialized lateinit variable --- .../simplemobiletools/gallery/activities/MediaActivity.kt | 5 ++--- .../gallery/activities/ViewPagerActivity.kt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index ccc09a886..90dd25390 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -34,8 +34,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private var mSnackbar: Snackbar? = null - lateinit var mToBeDeleted: ArrayList - lateinit var mMedia: ArrayList + private var mToBeDeleted = ArrayList() + private var mMedia = ArrayList() private var mPath = "" private var mIsGetImageIntent = false @@ -55,7 +55,6 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { media_holder.setOnRefreshListener({ getMedia() }) mPath = intent.getStringExtra(DIRECTORY) - mToBeDeleted = ArrayList() mMedia = ArrayList() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 099198594..a7b403f39 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -239,7 +239,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun reloadViewPager() { - GetMediaAsynctask(applicationContext, mDirectory, false, false, MediaActivity.mToBeDeleted) { + GetMediaAsynctask(applicationContext, mDirectory, false, false, ArrayList()) { mMedia = it if (isDirEmpty()) return@GetMediaAsynctask