Commit 0e9b71e7 authored by topjohnwu's avatar topjohnwu

Show notification on error

parent 85f5ff3c
......@@ -49,7 +49,11 @@ abstract class RemoteFileService : NotificationService() {
.doOnSubscribe { update(subject.hashCode()) { it.setContentTitle(subject.title) } }
.subscribeK(onError = {
Timber.e(it)
remove(subject.hashCode())
finishNotify(subject.hashCode()) { notification ->
notification.setContentText(getString(R.string.download_file_error))
.setSmallIcon(android.R.drawable.stat_notify_error)
.setOngoing(false)
}
}) {
val newId = finishNotify(it, subject)
get<Activity?>()?.run {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment