Declare ImageView in kotlin Android Studio [closed]

Use lateinit which will allow you to initialize the property later on.

lateinit var logo: ImageView

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    logo = findViewById(R.id.logo)
}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top