Skip to content

Commit a2a8c13

Browse files
committed
Also show a toast on error notification
since the notification is silent, also show a toast, otherwise the user is confused
1 parent c000c1d commit a2a8c13

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import android.content.Intent
88
import android.graphics.Color
99
import android.os.Build
1010
import android.view.View
11+
import android.widget.Toast
1112
import androidx.core.app.NotificationCompat
1213
import androidx.core.content.ContextCompat
1314
import androidx.fragment.app.Fragment
@@ -87,6 +88,10 @@ class ErrorUtil {
8788
)
8889

8990
notificationManager!!.notify(ERROR_REPORT_NOTIFICATION_ID, notificationBuilder.build())
91+
92+
// since the notification is silent, also show a toast, otherwise the user is confused
93+
Toast.makeText(context, R.string.error_report_notification_toast, Toast.LENGTH_SHORT)
94+
.show()
9095
}
9196

9297
private fun getErrorActivityIntent(context: Context, errorInfo: ErrorInfo): Intent {

app/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@
245245
<string name="permission_display_over_apps">Give permission to display over other apps</string>
246246
<!-- error activity -->
247247
<string name="error_report_notification_title">NewPipe encountered an error, tap to report</string>
248+
<string name="error_report_notification_toast">An error occurred, see the notification</string>
248249
<string name="sorry_string">Sorry, that should not have happened.</string>
249250
<string name="guru_meditation" translatable="false">Guru Meditation.</string>
250251
<string name="error_report_button_text">Report this error via e-mail</string>

0 commit comments

Comments
 (0)