delete file from mediastore on ViewPagerActivity in the background

This commit is contained in:
tibbi 2018-02-04 12:13:49 +01:00
parent 2ca0bded2d
commit 42faaf51c1
1 changed files with 4 additions and 2 deletions

View File

@ -181,8 +181,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
val file = File(mPath)
if (!file.exists()) {
deleteFromMediaStore(file)
if (!file.exists() && file.length() == 0L) {
Thread {
deleteFromMediaStore(file)
}.start()
finish()
return
}