From 79eb70d28bb15032ece6649325c88d5926b470fa Mon Sep 17 00:00:00 2001 From: AKIRA TAKEDA Date: Thu, 31 Mar 2022 13:18:58 +0900 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E5=AD=97=E5=88=97=E3=83=AA=E3=82=BD?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E5=8F=96=E5=BE=97=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=8C=E9=96=93=E9=81=95=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jp/atled/agileworks/widget/AwAppWidgetWorker.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/jp/atled/agileworks/widget/AwAppWidgetWorker.kt b/app/src/main/java/jp/atled/agileworks/widget/AwAppWidgetWorker.kt index 9a770fc8..166b4893 100644 --- a/app/src/main/java/jp/atled/agileworks/widget/AwAppWidgetWorker.kt +++ b/app/src/main/java/jp/atled/agileworks/widget/AwAppWidgetWorker.kt @@ -7,22 +7,23 @@ import android.os.Build import android.util.Log import androidx.work.Worker import androidx.work.WorkerParameters +import jp.atled.agileworks.AwApp import jp.atled.agileworks.R class AwAppWidgetWorker(context: Context, workerParams: WorkerParameters) : Worker(context, workerParams) { private val TAG = "AwAppWidgetWorker" val notificationManager = applicationContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager - val name = R.string.notification_channel_name_widget - val id = R.string.notification_channel_id_widget - val notifyDescription= R.string.notification_channel_description_widget + val name = AwApp.instance.resources.getString(R.string.notification_channel_name_widget) + val id = AwApp.instance.resources.getString(R.string.notification_channel_id_widget) + val notifyDescription= AwApp.instance.resources.getString(R.string.notification_channel_description_widget) init { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - notificationManager.getNotificationChannel(id.toString()) == null - val mChannel = NotificationChannel(id.toString(), name.toString(), NotificationManager.IMPORTANCE_HIGH) + notificationManager.getNotificationChannel(id) == null + val mChannel = NotificationChannel(id, name, NotificationManager.IMPORTANCE_HIGH) mChannel.apply { - description = notifyDescription.toString() + description = notifyDescription } } } -- GitLab