androidkotlinoverriding

Android: OnNewIntent overrides nothing


After recent updates to several libraries in my gradle, when I built my project, it gives me these two errors:

1. 'OnNewIntent' overrides nothing
2. 'dispatchKeyEvent' overrides nothing

I see that these functions are now locked and cannot be overridden. But what are the alternate to these functions now?


Solution

  • The parameter just became not Nullable. So just remove ? for the type KeyEvent

    Change this

    override fun dispatchKeyEvent(event: KeyEvent?)
    

    to

    override fun dispatchKeyEvent(event: KeyEvent)
    

    Same goes for OnNewIntent