I just began learning Kotlin for work and one of the first errors I encountered is “overrides nothing” pointing at the overrides of the function instantiateItem() for my PagerAdapter
The function/method signature was like this:
override fun instantiateItem(parent: ViewGroup?, position: Int): Any {
To fix the error, I simply removed the question mark from the arguments so that it looked like:
override fun instantiateItem(parent: ViewGroup, position: Int): Any {
Voila! Error gone and the swipe view that needed the PagerAdapter worked.
Reference: Sudden “overrides nothing” errors appear, no recent change to Kotlin build version
Related Posts
The homo sapiens behind these blog posts is “Catzie“
An odd human being who happens to have a variety of ever-changing interests, but these days she is often caught coding (Web and Android App Developer for a total of 14+ years!), optimizing this blog, tweaking a Traveler’s Notebook, refilling a cheap fountain pen, making up silly song/rap lyrics, watching K-pop performances, concocting unusual dessert/drink flavors, making scented candles, drawing, painting water-based mixed media pieces, obsessing about how some things works and what unfamiliar words mean, automating repetitive chores, anime, video games… Ran online dessert shops Cookies PH and Catzie’s Cakery in her past life.