Search code examples
androidandroid-studiointellij-ideakotlincode-inspection

Create code inspection for views in Android Studio for Kotlin


I would like to create a kotlin code inspection for invoking of view's id reference. In settings I cannot see an option for adding a kotlin code inspection.

enter image description here

My goal is to inspect when I don't write a nullable id reference to .xml's type of widget in a kotlin class.

For example:

etMain.text = "" -> and it should inspect that I could write with nullable type: etMain?.text = ""

Do you have any idea how could I achieve that?


Solution

  • There is related issue on YouTrack: https://youtrack.jetbrains.com/issue/KT-10176. Please follow it for updates.