From cff0a98227392fa37b693e53c29f77a89210c380 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:14:01 +0300 Subject: [PATCH] fixed download video notification --- .../java/ru/vtosters/lite/downloaders/VideoDownloader.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/downloaders/VideoDownloader.java b/app/src/main/java/ru/vtosters/lite/downloaders/VideoDownloader.java index 2eb71233c..edbfd11b3 100644 --- a/app/src/main/java/ru/vtosters/lite/downloaders/VideoDownloader.java +++ b/app/src/main/java/ru/vtosters/lite/downloaders/VideoDownloader.java @@ -89,12 +89,12 @@ public class VideoDownloader { } String notificationTitle = "Загрузка видео"; - String[][] notificationText = {{"Загрузка началась"}}; + String notificationText = "Загрузка началась"; NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(AndroidUtils.getGlobalContext(), channelId) .setSmallIcon(R.drawable.ic_download_24) .setContentTitle(notificationTitle) - .setContentText(notificationText[0][0]) + .setContentText(notificationText) .setProgress(0, 0, true) .setOngoing(true); @@ -134,10 +134,9 @@ public class VideoDownloader { outputStream.write(buffer, 0, bytesRead); totalBytesRead += bytesRead; int progress = (int) ((totalBytesRead * 100) / fileSize); - notificationText[0][0] = "Загружено " + progress + "%"; notificationBuilder.setProgress(100, progress, false) - .setContentText(notificationText[0][0]); + .setContentText("Загружено " + progress + "%"); notificationManager.notify(notificationId, notificationBuilder.build()); }