File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/error Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import android.widget.Toast
1010import androidx.core.app.NotificationCompat
1111import androidx.core.app.NotificationManagerCompat
1212import androidx.core.app.PendingIntentCompat
13+ import androidx.core.content.ContextCompat
1314import androidx.fragment.app.Fragment
1415import androidx.preference.PreferenceManager
1516import com.google.android.material.snackbar.Snackbar
@@ -136,9 +137,11 @@ class ErrorUtil {
136137 NotificationManagerCompat .from(context)
137138 .notify(ERROR_REPORT_NOTIFICATION_ID , notificationBuilder.build())
138139
139- // since the notification is silent, also show a toast, otherwise the user is confused
140- Toast .makeText(context, R .string.error_report_notification_toast, Toast .LENGTH_SHORT )
141- .show()
140+ ContextCompat .getMainExecutor(context).execute {
141+ // since the notification is silent, also show a toast, otherwise the user is confused
142+ Toast .makeText(context, R .string.error_report_notification_toast, Toast .LENGTH_SHORT )
143+ .show()
144+ }
142145 }
143146
144147 private fun getErrorActivityIntent (context : Context , errorInfo : ErrorInfo ): Intent {
You can’t perform that action at this time.
0 commit comments