From 950956ebf22ef72c54c73cf30941bb1a87e6df3b Mon Sep 17 00:00:00 2001 From: Stypox Date: Sat, 4 Dec 2021 10:45:15 +0100 Subject: [PATCH] Also show a toast on error notification since the notification is silent, also show a toast, otherwise the user is confused --- app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt | 5 +++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt b/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt index 5fb8bff92..b766d91c6 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt @@ -8,6 +8,7 @@ import android.content.Intent import android.graphics.Color import android.os.Build import android.view.View +import android.widget.Toast import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment @@ -87,6 +88,10 @@ class ErrorUtil { ) notificationManager!!.notify(ERROR_REPORT_NOTIFICATION_ID, notificationBuilder.build()) + + // since the notification is silent, also show a toast, otherwise the user is confused + Toast.makeText(context, R.string.error_report_notification_toast, Toast.LENGTH_SHORT) + .show() } private fun getErrorActivityIntent(context: Context, errorInfo: ErrorInfo): Intent { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4acd04d27..cc518e2bb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -245,6 +245,7 @@ Give permission to display over other apps NewPipe encountered an error, tap to report + An error occurred, see the notification Sorry, that should not have happened. Guru Meditation. Report this error via e-mail