why is getString from the new resources library ma...
# compose-desktop
g
why is getString from the new resources library marked as suspend now in beta-02? Doesn't that kinda defeat the purpose? drawables aren't marked suspend.
k
use
stringResources
. it is not suspend
the suspend getString for non-compose code
👍🏻 1
g
Nevermind I see it's been updated on master too, I stand corrected. All good
k
this is not demo 🤷
b
I have small question according it. All my strings placed in shared module. And for example I need use it in androidMain Service class. Previously with android approach in notification builder for example I just called getString as ordinary method. But now I should implement coroutine launching something like this:
Copy code
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
    super.onStartCommand(intent, flags, startId)
    ....
    lifecycleScope.launch {
            val title = org.jetbrains.compose.resources.getString(Res.string.prepare)
            val stickyNotificationBuilder = NotificationCompat.Builder(this, notificationChannelId)
              .setContentTitle(title)
              .setSmallIcon(R.drawable.baseline_timer_24)
            ....
            startForeground(
                stickyNotificationId,
                stickyNotificationBuilder.build())
    }
}
Is it ok or you can suggest something better? Do you plan to implement sync method?
m
@brucemax I'm also confused about this exact thing. What did you end up doing?