簡體   English   中英

覆蓋所需的注釋而不是 - Kotlin

[英]Override annotation required and not - Kotlin

相關: 錯誤:onActivityResult不會覆蓋任何內容

我已經嘗試過Dhaval Patel的解決方案並獲得報告,它不會覆蓋我的解析器。 省略覆蓋注釋會報告它隱藏了超級方法並且需要覆蓋。 我的解析器有問題嗎?

文檔如何實現該方法(不會編譯) https://developer.android.com/training/basics/intents/result

我如何只獲得解析器警告 - 覆蓋任何內容,覆蓋冗余

override fun onActivityResult(requestCode:Int, resultCode:Int, data:Intent?) 

如何獲得編譯錯誤 - 覆蓋所需的注釋:

fun onActivityResult(requestCode:Int, resultCode:Int, data:Intent?)

感謝byxor提供的線索,我查看了build.grade

我的IDE(Android Studio)報告了它的Kotlin版本和文檔中的版本不匹配。 我已升級到1.3.11,它通過識別覆蓋注釋的需要解決了這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM