Remove findViewById in Kotlin-Android
Remove findViewById in Kotlin From the newbie to the oldest developers in Android development knows the use of findViewById(). It is by far the commonest method used. When using this we associate a link between the XML view to the object view in Java file. Let me remind the terminology for this, well this exactly what we refer to as View Binding. In Kotlin, view binding is far more feasible and easy, as we got here a new plugin to add, and whoosh no findViewById() to remember every time we create a new view object. All you need to do is add a line in your 'build.gradle' file and its done. apply plugin: 'kotlin-android-extensions' Now, how do we use this? import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) btnNextScreen.setOnClickListener{ ...