properly catch exceptions thrown in the background
This commit is contained in:
parent
7605e90632
commit
150aace3ca
1 changed files with 5 additions and 5 deletions
|
@ -872,12 +872,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
mLatestMediaDateId = getLatestMediaByDateId()
|
mLatestMediaDateId = getLatestMediaByDateId()
|
||||||
if (!isFromCache) {
|
if (!isFromCache) {
|
||||||
val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium }
|
val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium }
|
||||||
try {
|
Thread {
|
||||||
Thread {
|
try {
|
||||||
mediaDB.insertAll(mediaToInsert)
|
mediaDB.insertAll(mediaToInsert)
|
||||||
}.start()
|
} catch (e: Exception) {
|
||||||
} catch (e: Exception) {
|
}
|
||||||
}
|
}.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue