fix some crashes related unitialized lateinit variable

This commit is contained in:
tibbi 2016-12-06 00:04:27 +01:00
parent 32a91a7de9
commit f0f07d9c8d
2 changed files with 3 additions and 4 deletions

View file

@ -34,8 +34,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private var mSnackbar: Snackbar? = null private var mSnackbar: Snackbar? = null
lateinit var mToBeDeleted: ArrayList<String> private var mToBeDeleted = ArrayList<String>()
lateinit var mMedia: ArrayList<Medium> private var mMedia = ArrayList<Medium>()
private var mPath = "" private var mPath = ""
private var mIsGetImageIntent = false private var mIsGetImageIntent = false
@ -55,7 +55,6 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
media_holder.setOnRefreshListener({ getMedia() }) media_holder.setOnRefreshListener({ getMedia() })
mPath = intent.getStringExtra(DIRECTORY) mPath = intent.getStringExtra(DIRECTORY)
mToBeDeleted = ArrayList<String>()
mMedia = ArrayList<Medium>() mMedia = ArrayList<Medium>()
} }

View file

@ -239,7 +239,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} }
private fun reloadViewPager() { private fun reloadViewPager() {
GetMediaAsynctask(applicationContext, mDirectory, false, false, MediaActivity.mToBeDeleted) { GetMediaAsynctask(applicationContext, mDirectory, false, false, ArrayList<String>()) {
mMedia = it mMedia = it
if (isDirEmpty()) if (isDirEmpty())
return@GetMediaAsynctask return@GetMediaAsynctask