try removing temp folder at app start too, if available

This commit is contained in:
tibbi 2017-09-05 22:23:15 +02:00
parent 54a4d29233
commit 51b4d9981f

View file

@ -73,7 +73,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent ||
mIsGetAnyContentIntent || mIsSetWallpaperIntent mIsGetAnyContentIntent || mIsSetWallpaperIntent
config.tempFolderPath = "" removeTempFolder()
directories_refresh_layout.setOnRefreshListener({ getDirectories() }) directories_refresh_layout.setOnRefreshListener({ getDirectories() })
mDirs = ArrayList() mDirs = ArrayList()
mStoredAnimateGifs = config.animateGifs mStoredAnimateGifs = config.animateGifs
@ -159,7 +159,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
config.temporarilyShowHidden = false config.temporarilyShowHidden = false
removeTempFolder()
}
private fun removeTempFolder() {
val newFolder = File(config.tempFolderPath) val newFolder = File(config.tempFolderPath)
if (newFolder.exists() && newFolder.isDirectory) { if (newFolder.exists() && newFolder.isDirectory) {
if (newFolder.list()?.isEmpty() == true) { if (newFolder.list()?.isEmpty() == true) {