I'm trying to extend android.service.wallpaper.WallpaperService.Engine
class in Kotlin, but I get "Unresolved reference" error:
Even though it is clearly imported above.
Is there any way to fix this?
The issue is that the WallpaperService.Engine
is a class enclosed within WallpaperService
class (it is obvious once you see it), and is not static, and thus must be tied to a instance of a WallpaperService
class, in other words, it must be declared as an inner
class of a WallpaperService
class:
import android.service.wallpaper.WallpaperService
class MyWallpaperService : WallpaperService() {
...
inner class MyEngine : Engine() {
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With