catch and show exceptions thrown at importing clips from a file
This commit is contained in:
parent
dd59e51bec
commit
a20ab59df5
|
@ -175,6 +175,7 @@ class ManageClipboardItemsActivity : SimpleActivity(), RefreshRecyclerViewListen
|
|||
|
||||
var clipsImported = 0
|
||||
ensureBackgroundThread {
|
||||
try {
|
||||
val token = object : TypeToken<List<String>>() {}.type
|
||||
val clipValues = Gson().fromJson<ArrayList<String>>(inputStream.bufferedReader(), token) ?: ArrayList()
|
||||
clipValues.forEach { value ->
|
||||
|
@ -189,6 +190,9 @@ class ManageClipboardItemsActivity : SimpleActivity(), RefreshRecyclerViewListen
|
|||
toast(msg)
|
||||
updateClips()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue