media icon indicating copy to clipboard operation
media copied to clipboard

DownloadService is hard to configure via Hilt

Open yschimke opened this issue 3 years ago • 1 comments

Because the constructor of DownloadService takes parameters instead of it being configured at some point before onCreate, it isn't possible to build a reusable DownloadService implementation and then customise via Hilt injection.

    DownloadService(
        downloadNotificationId,
        DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL,
        channelId,
        downloadChannelNameResourceId,
        downloadChannelDescriptionResourceId
    ) {

yschimke avatar Jun 20 '22 17:06 yschimke

I'm starting with Hilt and I'm currently stuck with it. Is there some kind of workaround for this ? Thanks

JJSarrasin avatar Jul 01 '22 15:07 JJSarrasin